, LinqPad Excel. HTML Ms-Excel.
( , XLS, EXCEL ).
HTML, LinqPad hyperlinq.
void Main()
{
var filePath = Path.GetTempPath() + "output.html";
var iEnumerbleValue = Enumerable.Range(1, 500).Select(e => new { a = 1, b = e });
File.WriteAllText(filePath, CreateHtml(iEnumerbleValue).ToString());
Process.Start("EXCEL.EXE", filePath);
}
HDoc CreateHtml<T>(IEnumerable<T> coll)
{
var fields = typeof(T).GetProperties();
return H.Doc(
H.head(H.style()),
H.body(
H.table(
H.tbody(
H.tr(fields.Select(f => H.th(f.Name))),
from item in coll
select H.tr(
fields.Select(f => H.td(f.GetValue(item)))
)
)
)
)
);
}