title: Excel Template Bulk Printing C# Windows Application
body: <p>I have been working on a Windows application in C#. My Requirement is to print a predefined Excel Template with database values for a given Order Number. Means, i have to retrieve data from database(SQL Server) and replacing predefined cell values(Text) (in excel template) with database value.  For Example -</p>
  
  <p>In Excel-cell value "SENDER_NAME" will be replaced by "FEDEX", "OrderNo" will be replaced by "1212" and so on. I am using following code to do that.</p>
  
  <pre><code>object missingValue = Type.Missing;
  
  xlWorkBook = xlApp.Workbooks.Open(path, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
  
  xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
  
  xlWorkSheet.Cells.Replace("SENDER_NAME", "FEDEX", missingValue, missingValue, missingValue, missingValue, missingValue, missingValue);
  </code></pre>
  
  <p>My PROBLEM is - When some values are not present in database for a given cell text in excel , its replaced by blank value, so it lefts empty spaces while printing. 
  I have to cut down those empty spaces??</p>
  
  <p>I just want, that empty space should not be visible into the print. Problem is that empty cell is printing as blank space, so for example AddressLine2 is not in Db. then it will look like following.</p>
  
  <pre><code>AddressLine1
  EMPTYCELL
  AddressLin3
  </code></pre>
  
  <p>I want the output like </p>
  
  <pre><code>AddressLine1
  AddressLine3
  </code></pre>
  
  <p>Any solution? </p>