Xporter 1.0.1

dotnet add package Xporter --version 1.0.1
                    
NuGet\Install-Package Xporter -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xporter" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xporter" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Xporter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xporter --version 1.0.1
                    
#r "nuget: Xporter, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Xporter@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xporter&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Xporter&version=1.0.1
                    
Install as a Cake Tool

Xporter

CI

"Xporter" allows users to export Spreadsheet files easily from either any object type or list of properties as a source, using also if they want pre-existing .xlsx files as Templates.

Contents

The problem

Installation

How to use

Simple Example

ToDo

License

The problem

Imagine having different types of data and you want to export them easily in an xlsx file. You may need this at your work, to present any kind of statistics.. Its necessary to have a service that exports any kind of data that you will provide to it.

Like the method below:

public static void InsertData(List<object> objects)
{
}

OR

public static void InsertData(List<AnyTypeHere> listOfAnyType)
{
}

Instalation (4 ways)

(1) [Using NuGet]

Search into the NuGet (prerelease) packages the library or run the following command:

PM> Install-Package Xporter -Version $(AssemblyVersion)

(2) [Manual]
  • Download this repository: <a href="https://github.com/dimgrev/Xporter/archive/main.zip" target="_blank">here</a>
  • Unzip downloaded file
  • Copy the resulting folder to app/Plugin
  • Rename the folder you copied to utilityXporter
(3) [GIT Submodule]

In your app directory type:

  git submodule add -b master git://github.com/dimgrev/Xporter.git 
Plugin/utilityXporter
  git submodule init
  git submodule update
(4) [GIT Clone]

In your Plugin directory type:

  git clone -b master git://github.com/dimgrev/Xporter.git 
UtilityXporter

How to use

To use this library, add a using statement for Xporter {using Xporter;}

Now you can call the base static class named "Xport."

and on that class call one of three methods:

* Xport.LoadFromFileInfo()
* Xport.LoadFromFileStream()
* Xport.CreateNewPackage()

Then you can use the library extensions methods listed below as you like:

* .Clear()			+1 overload	--> to clear the data of a worksheet or clear all sheets of a file
* .LoadTempl()		+1 overload	--> to load a template from another xlsx file to the current one
* .InsertData()		+2 overloads	--> to insert any kind of data from a model all other source
* .WriteToCells()	+1 overload	--> to write something in specified cells
* .InsertToCells() 	+1 overload	--> to replace all cells containing a specific string with another string

Simple Example

```C#
	using Xporter;

	var cellProps = new CellProperties();
		cellProps.Add("E2", "Stats");
		cellProps.Add("E3", "TypeOfProduct");
		cellProps.Add("E4", "Images");
		cellProps.Add("I2", DateTime.Now.ToString("yyyy-MM-dd"));

	Xport.LoadFromFileInfo(new FileInfo("C:\\Users\\{YourPcName}\\Desktop\\MyFile.xlsx"))
		.Clear()
		.LoadTempl(new FileInfo("C:\\Users\\{YourPcName}\\Desktop\\TemplateFile.xlsx"))
		.InsertData(yourListOfAnyType, startingRow, startingCol)
		.WriteToCells(cellProps)
		.InsertToCells("NAME", "John")    //Replace all cells containing "NAME" with "John"
		.Save();
```

It's that simple! Awesome, right? ♥

ToDo

  • Maybe the ability to modify xlsx file's style

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 158 3/18/2026
0.2.3-alpha 320 5/9/2023
0.2.2-alpha 1,150 4/19/2021 0.2.2-alpha is deprecated because it is no longer maintained.

Version 1.0.1 (stable)
- Improved handling of objects of the same type
- Added InsertToCells() method
- Removed AutoFitColumns to prevent unintended changes to templates
- Optimized performance and internal code structure