Adsence750x90

Saturday, July 4, 2020

Export to Excel using OpenXml


Some situations we need to export data in Excel format. I had such situation couple of years back and I created a repository in my bitbucket account.

I thought it may be help for some one who is looking for same kind of solution while programming.

Here is the repository url
https://bitbucket.org/makhaai/exporttoexcel/src/master/ 


for Git Clone
git clone https://makhaai@bitbucket.org/makhaai/exporttoexcel.git


This includes there project. One model Library, One Service Library and a MVC project. 












Basically we can plug  List data in to it and download it as Excel document 


   public FileContentResult Download() {

            List> listOfSheets = new List>() {
                    new ExcelSheet() {
                     Records =Data.GetProducts(),
                     SheetName = "ProductList 1"
                },
                 new ExcelSheet() {
                     Records =Data.GetProducts(),
                     SheetName = "ProductList 2"
                },
            };

            var excelBytes = _iExcelWriterService.GetExcelInBytes(listOfSheets);
            var fileName = string.Format("{0}_{1}.xlsx",
                                      "Products_", DateTime.Now.ToString("MMddyyyyHHmmssfff"));
            return excelBytes != null ? File(excelBytes,
                                             "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
                                              fileName) : null;
        }

Online typing tool


Apologies, I was out of track in a while. I will be starting my blogging again for good.
Last couple of month I was working on some of my personal project. couple of them will be online in weeks. 
One project I wish to discuss now. Its EazyTyping.com, Its a online typing tool that uses google translation API and it having one typing game for users. Uses can mainly type Hindi, Malayalam, Guajarati etc.

Feel free to comment.

Thank you