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. FlexCel Studio for the .NET Framework 7.11.0.0 Page 1 of 2 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. FlexCel Studio for the .NET Framework 7.11.0.0 Page 2 of 2 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> FlexCel Studio for the .NET Framework 7.11.0.0 Page 1 of 4 So if for example the FlexCel package is at C: \Users\adrian\Documents\TMSSoftware\FlexCelNET\nuget your screen should look as follows: NOTE You can also visually manage your package sources by going to Menu->Tools->NuGet Package Manager->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: FlexCel Studio for the .NET Framework 7.11.0.0 Page 2 of 4 Once in the package manager, follow the steps: 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. FlexCel Studio for the .NET Framework 7.11.0.0 Page 3 of 4 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. FlexCel Studio for the .NET Framework 7.11.0.0 Page 4 of 4 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: FlexCel Studio for the .NET Framework 7.11.0.0 Page 1 of 9 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.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages402 Page
-
File Size-