create excel in controller and download to user

ساخت وبلاگ

Vote count: 0

I'm stuck in this problem. I need to buid a excel file from some info retreived from my database into my controller and just by calling the ActionResponse, this download the file, i been using gembox spreadsheet but run out of downloads pretty quickly, this is the logic of my controller:

 public ActionResult Report() { IList MyClientList = new List(); DataBaseDataContext table = new DataBaseDataContext(); var query = from u in table.Subscriptions where u.partnerid_mpn == Convert.ToInt32(id) select u; var list = query.ToList(); if (query.Count() > 0) { foreach (var item in list) { ClientNode node = new ClientNode(); node.Id = item.id_client; node.Name = item.Name; MyClientList.Add(node); } } //create the file here based in the list and return it to user return View(); }

Thanks to any answer. :)

asked 55 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 335 تاريخ : چهارشنبه 27 ارديبهشت 1396 ساعت: 10:55