all blog posts

Create Excels with C# and EPPlus: Import

IEnumerable objects

Exporting data to an Excel doesn’t get easier than this

using (var package = new ExcelPackage())
	var sheet = package.Workbook.Worksheets.Add("IEnumerable");
	var data = new[]
		new {Name = "A", Value = 1},
		new {Name = "B", Value = 2},
		new {Name = "C", Value = 3},
	sheet.Cells["A1"].SetHeaders("Name", "Value");
	package.SaveAs(new FileInfo(@""));
1 May 2017
excel tutorial

NSubstitute vs Moq

Comparing NSubstitute syntax with Moq, probably the most used mocking framework out there at the moment.

moq/moq4 :

nsubstitute/nsubstitute :

30 Apr 2017
tutorial testing

Create Excels with C# and EPPlus: Formulas & DataValidation

In case your users want to continue working with the Excels after generation.

Not a problem for EPPlus. Instead of calculating values and writing them to an excel, leverage the power of Excel formulas.

27 Apr 2017
excel tutorial

Create Excels with C# and EPPlus: A tutorial

Version is the last version of EPPlus you can use without a license for commercial use.
See some alternatives if that is a dealbreaker for you!

26 Apr 2017
excel tutorial

Advanced Windows Explorer

A listing of handy but less known shortcuts in Windows Explorer and some Autohotkey examples on how to add extra functionality.

Open Windows Explorer, the most direct way:

Win + E : Open Windows Explorer

22 Apr 2017
autohotkey powershell windows

PowerShell and Git for the colorblind

My PowerShell, Posh-Git and .gitconfig color configuration because of some red-green troubles with the default configurations.

21 Apr 2017
powershell git

.NET Number and Date Formatting

A cheat sheet with everything there is to know about formatting the primitive types, DateTimes and TimeSpans in .NET.

20 Apr 2017

VB.NET vs C# Syntax differences

A cheat sheet outlining the syntax differences between VB.NET and C#. This post is written specifically for advanced C# developers with little to no VB.NET knowledge who need to do some VB.NET coding.

Because some things are just so similar but still confusingly different in VB.NET vs C#…

Along the way we’ll make some amazing discoveries like:

  • There are things VB.NET just can’t do (pointers, …)
  • There are a few cases where VB.NET code is shorter than its C# counterpart (gasp!)
  • VB.NET defaults are not what you might expect from a strongly typed language due to its VB6 legacy (Option Strict, Explicit)
  • There is some VB.NET only stuff that comes in handy from time to time
15 Apr 2017