title: Generating more than one CSV File using DataTables Data on ASP.NET MVC using WebAPI and highlight Cell based on the condition
body: <p>I have ASP.NET MVC AngularJS/JQuery Application which makes WebAPI calls for returning the data back.</p>
  
  <p>I have to read the data from the database table and generate two CSV files.</p>
  
  <p>Here I drafted the code with sample DataTable data and here we have two different tables since their columns are different. I have to generate both the CSV Files on button Click itself.</p>
  
  <pre><code>public IHttpActionResult GenerateValidationCSVFiles(string submissionId)
      {
          try
          {
              //Based on the SubmissionID, we get data 
              //Account Table 
              DataTable tblAccount = new DataTable();
  
              tblAccount.Columns.Add("AccountID", typeof(int));
              tblAccount.Columns.Add("NAME", typeof(string));
              tblAccount.Columns.Add("Email", typeof(string));
  
              tblAccount.Rows.Add(111, "John", "John@abc.com");
              tblAccount.Rows.Add(222, "Mike", "Mike@xyz.com");
              tblAccount.Rows.Add(102, "Meghan", "Meghan@123.com");
  
              //Location Table
              DataTable tblLocation = new DataTable();
  
              tblLocation.Columns.Add("AccountID", typeof(int));
              tblLocation.Columns.Add("LocName", typeof(string));
              tblLocation.Columns.Add("Address", typeof(string));
              tblLocation.Columns.Add("CITY", typeof(string));
              tblLocation.Columns.Add("Zipcode", typeof(string));
  
              tblLocation.Rows.Add(111, "John", "123 Lake Dr", "Newyork", "12345");
              tblLocation.Rows.Add(222, "Mike", "456 test Dr", "Kansas", "");
              tblLocation.Rows.Add(102, "Meghan", "345 Texico Pl", "San Francisco", "");
              tblLocation.Rows.Add(212, "Steve", "8989 Williow Cir", "Chicago", "");
  
              //Write logic to render as CSV File data
          }
          catch (Exception ex)
          {
              ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
              Log.Error("ERROR : " + ex.ToString());
              return Ok(ex.ToString());
          }
      }
  </code></pre>
  
  <p>Here I have sample Validation Rule like in the Location file, if Zipcode is not Empty, highlight that cell in Yellow color.</p>
  
  <p>What is the best way to generate CSV files using DataTable data and highlight the Cell? Whether to highlight on the Server side or CLient side and How?</p>
  
  <p>Appreciate your responses.</p>
  
  <p>Thanks</p>