Well, this certainly might have not been asked before.
I have a method that returns me an IQueryable, the client requirement is one specific example we should export that to excel without showing the results in a gridview.
Any idea?
string strSql = BuildQuery();
try
{
var list = RequestBaseBL.GetRequestByCustomQuery(strSql, DdlRequestType.SelectedValue).ToList();
to export in excel have a look here:
http://epplus.codeplex.com/releases/view/42439
then you can create your own class to generate excel export for IEnumerable
here some hint (these are part of more large object so only hints, nothing compiling surely) at the possible from one of my projects:
an example of implementation :
and the column class:
and its use :