@manhnguyenv

Welcome to my blog!

DataTables Export Excel JavaScript + EPPlus Excel Format

December 24, 2019 20:41

DataTables Export Excel JavaScript (edit)

http://live.datatables.net/yifojova/2/edit

https://www.datatables.net/download/nightly

EPPlus Report

http://zeeshanumardotnet.blogspot.com/2011/06/creating-reports-in-excel-2007-using.html

EPPlus Samples Code

https://github.com/JanKallman/EPPlus/tree/master/SampleApp

https://www.c-sharpcorner.com/blogs/how-to-format-excel-table-using-epplus-net-library-c-sharp-part-fifteen (HAY)

EPPlus Ignore Excel Warning

https://stackoverflow.com/questions/26483496/is-it-possible-to-ignore-excel-warnings-when-generating-spreadsheets-using-epplu/

https://stackoverflow.com/questions/26483496/is-it-possible-to-ignore-excel-warnings-when-generating-spreadsheets-using-epplu/26484880#26484880

https://support.office.com/en-gb/article/block-or-unblock-external-content-in-office-documents-10204ae0-0621-411f-b0d6-575b0847a795

EPPlus Excel Format

https://github.com/JanKallman/EPPlus/wiki/Formatting-and-styling

https://www.c-sharpcorner.com/blogs/how-to-apply-cell-text-background-color-in-excel-sheet-using-epplus

EPPlus Excel Format

https://www.codeproject.com/Articles/1194712/Advanced-Excels-With-EPPlus

https://www.c-sharpcorner.com/blogs/how-to-format-excel-table-using-epplus-net-library-c-sharp-part-fifteen

https://riptutorial.com/epplus/topic/8219/styling-the-excel-document

EPPlus Example

using (var xlsx = File.Create("Text.xlsx"))
        using (var pkg = new ExcelPackage())
        {
            var ws = pkg.Workbook.Worksheets.Add("Sheet1");
            var r = 0;
            ws.Cells[++r, 1].Value = "Values";
            ws.Cells[++r, 1].Value = 1171.2;
            ws.Cells[++r, 1].Value = 1.1;
            ws.Cells[++r, 1].Value = 1.2;
            ws.Cells[++r, 1].Value = 1.3;
            ws.Column(1).Style.Numberformat.Format = "General";   // Default
            //ws.Column(1).Style.Numberformat.Format = "0.00";    // Numeric with fixed decimals
            //ws.Column(1).Style.Numberformat.Format = "@";       // Text
            pkg.SaveAs(xlsx);
        }

Text Format

https://riptutorial.com/epplus/example/27222/text-format

Number Format

https://riptutorial.com/epplus/example/26056/number-formatting

DateTime Format

https://riptutorial.com/epplus/example/26058/date-formatting

DataTable to Excel using EPPlus

var ws = MainExcel.Workbook.Worksheets.First();
 DataTable tbl = new DataTable();
 for (var rowNum = 1; rowNum <= ws.Dimension.End.Row; rowNum++)      
 {
     var wsRow = ws.Cells[rowNum, 1, rowNum, ws.Dimension.End.Column];
     var array = wsRow.Value as object[,];

     var row = tbl.NewRow();
     int hhh =0;

     foreach (var cell in wsRow)
          {
           cell.Style.Numberformat.Format = "@";
           row[cell.Start.Column - 1] = cell.Text;
          }
     tbl.Rows.Add(row);
 }

Range

using (var range = worksheet.Cells[1, 1, 1, 5])  //Address "A1:A5"
{
    range.Style.Font.Bold = true;
    range.Style.Fill.PatternType = ExcelFillStyle.Solid;
    range.Style.Fill.BackgroundColor.SetColor(Color.DarkBlue);
    range.Style.Font.Color.SetColor(Color.White);
}

Number format

worksheet.Cells["A1:B3,D1:E57"].Style.NumberFormat.Format = "#,##0"; //Sets the numberformat for a range containing two addresses.
worksheet.Cells["C2:C5"].Style.Numberformat.Format = "#,##0";

Font

worksheet.Cells["A:B"].Style.Font.Bold = true; //Sets font-bold to true for column A & B
worksheet.Cells["1:1,A:A,C3"].Style.Font.Bold = true; //Sets font-bold to true for row 1,column A and cell C3
worksheet.Cells["A:XFD"].Style.Font.Name = "Arial"; //Sets font to Arial for all cells in a worksheet.

DateTime format

ws.Column(1).Style.Numberformat.Format  = "yyyy-mm-dd"; 
//OR "yyyy-mm-dd h:mm" if you want to include the time!

Border thin

https://www.c-sharpcorner.com/blogs/how-to-apply-cell-border-style-on-excel-sheet-using-epplus-net-application-c-sharp-part3

Background Color

//Sets the background color for the selected range (default is A1).
//A range is selected using the by using the worksheet.Select method
worksheet.Cells.Style.Fill.PatternType = ExcelFillStyle.Solid;
worksheet.Cells.Style.Fill.BackgroundColor.SetColor(Color.LightGreen);

jQuery DataTables

June 28, 2019 22:37

jQuery DataTables (edit)

https://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part

https://www.codeproject.com/Articles/165410/ASP-NET-MVC-Editable-DataTable-jQuery-DataTables-a

https://stackoverflow.com/questions/44002822/how-to-refresh-datatables-plug-in-for-jquery

https://datatellblog.wordpress.com/2015/08/01/server-side-paging-with-datatables-net-and-mvc/

http://www.cyqdata.com/cnblogs/article-detail-35087-english

https://social.technet.microsoft.com/wiki/contents/articles/39961.beginners-guide-to-implement-ajax-crud-operations-using-jquery-datatables-in-asp-net-mvc-5.aspx?Sort=MostRecent&PageIndex=1

https://www.c-sharpcorner.com/article/using-datatables-grid-with-asp-net-mvc/

https://www.codeproject.com/Articles/177335/Refreshing-content-of-the-table-using-AJAX-in-ASP

https://www.c-sharpcorner.com/article/ajax-crud-operation-with-jquery-datatables-in-asp-net-mvc-5-for-beginners/

https://www.codaffection.com/asp-net-mvc-tutorial/asp-net-mvc-with-jquery-ajax/

https://datatables.net/forums/discussion/25012/having-trouble-getting-ajax-to-work

https://datatables.net/examples/server_side/defer_loading.html

https://www.linkedin.com/pulse/beginners-guide-ajax-crud-using-jquery-datatables-aspnet-ehsan-sajjad

http://developmentpassion.blogspot.com/2017/06/ajax-crud-in-grid-using-jquery.html

https://clip-share.net/rev/asp+net+mvc+tutorial+for+beginners+with+bootstrap+and+jquery/

Email: technotipstutorial@gmail.com

dataTables

March 11, 2018 02:15

jQuery DataTables

https://datatables.net/examples/server_side/

https://datatables.net/examples/server_side/post.html

https://editor.datatables.net/examples/simple/server-side-processing.html

Web.config

https://stackoverflow.com/questions/11636386/how-to-configure-the-web-config-to-allow-requests-of-any-length

  • ASP.NET Runtime : These limits are lifted using the httpRuntime node and its associated attributes
  • IIS Requests Filtering module : IIS also applies its own filtering rules regarding URL and Query String length, even before the request is processed by the ASP.NET Runtime. By default, the maximum allowed length for a query string is 2048 (see here). You should set the appropriate values in your Web.config, under the requestLimits subnodes, eg :

    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxQueryString="4096"/>
        </requestFiltering>
      </security>
    </system.webServer>

jQuery DataTables Service Side Processing (HAY)

https://www.codeproject.com/Tips/1011531/Using-jQuery-DataTables-with-Server-Side-Processin

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <security>
        <requestFiltering>
            <requestLimits maxQueryString="32768"/>
        </requestFiltering>
    </security>

https://datatables.net/media/blog/beautiful_tables/complete.html

https://world.episerver.com/documentation/upgrading/Episerver-CMS/8/upgrading-from-mvc-4-to-5/

https://docs.microsoft.com/en-us/aspnet/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2

  • Javascript
  • HTML
  • CSS
  • Ajax
  • Server-side script

jQuery DataTables

https://editor.datatables.net/examples/advanced/jsonId.html

jQuery DataTables for Beginners

https://www.codeproject.com/Tips/844403/jQuery-Datatables-For-Beginners

CSS for jQuery DataTables

https://datatables.net/forums/discussion/39890/passing-parameters-to-column-render-function

http://jsfiddle.net/jasonblewis/u9en604m/

http://jsfiddle.net/jasonblewis/u9en604m/4/

https://stackoverflow.com/questions/41982049/jquery-datatables-render-column-data

Ajax CRUD Operations with Grid using JQuery DataTables in ASP.NET MVC 5

https://code.msdn.microsoft.com/Implement-Ajax-CRUD-a543a978

https://gallery.technet.microsoft.com/Ajax-CRUD-Operations-with-d005e974

AJAX CRUD in GridView using JQuery DataTables in ASP.NET MVC 5

Ajax server paging, searching with jQuery DataTables

http://developmentpassion.blogspot.com/2017/06/ajax-crud-in-grid-using-jquery.html

https://www.c-sharpcorner.com/article/crud-operations-in-mvc-using-entity-framework-with-ajax-call-jquery-and-all-val/

https://www.c-sharpcorner.com/article/using-jquery-datatables-grid-with-asp-net-core-mvc/

http://www.webslesson.info/2017/01/php-pdo-ajax-crud-with-data-tables-and-bootstrap-modals.html

CRUD, Upload Image

https://phppot.com/php/twitter-like-profile-image-upload-using-jquery-ajax/

Upload files

https://phppot.com/php/pause-resume-file-upload-using-javascript/

https://phppot.com/php/multiple-file-upload-using-fine-uploader/

Demo

https://phppot.com/demo/multiple-file-upload-using-fineuploader/

ASP.NET

https://docs.microsoft.com/en-us/aspnet/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/display_data_items_and_details

Categories