title: Best method in writing this ColdFusion based report
body: <p>I'm looking to see what the best way in writing this report which I'm developing in ColdFusion 10 would be.</p>
  
  <p>Basically, it consists of reading data from two tables in a MSSQL database, applying some conditions based on what it finds on a specific column, populating the data into excel and sending it out via email. I've written reports before where it's as simple as reading data from the table, using POIUTILITY to create the spreadsheet and sending it via email, but this one is a little different because of the conditions. I've read about using cfspreadsheet instead of poiutility, but I'm not so sure in this case.</p>
  
  <p>Here’s an example of what the tables layout looks like as easy as I can put it:</p>
  
  <pre><code>Table1
  ID | Name | Address
  
  Table2 
  ID | AppsInfo
  </code></pre>
  
  <p>In the excel report, I’ll have one sheet where the data is laid out similar to the following:</p>
  
  <pre><code>ID    | Name  | Address | AppAlpha | AppBravo | AppDelta | 
  12345 | John  | 123 Ave | Yes      | Yes      | No       | 
  </code></pre>
  
  <p>My problem is, the AppsInfo column on table2 contains xml formatting for each ID :</p>
  
  <pre><code>&lt;start&gt;
  &lt;id=”12345”&gt;
  &lt;AppName=”AppDelta”&gt;
  &lt;AppName=”AppBravo”
  &lt;/id&gt;
  &lt;/start&gt;
  </code></pre>
  
  <p>In each row on my excel sheet, the data would be written out such that if appsinfo column for a specific ID contains an app, then list it as yes on the corresponding row, if it does not contain that app, then No.</p>
  
  <p>So going from layout example above, the final format of excel would display this way:</p>
  
  <pre><code>ID    | Name  | Address | AppAlpha | AppBravo | AppDelta |
  12345 | John  | 123 Ave | No       | Yes      | Yes      |
  </code></pre>
  
  <p>and so on and so on for each ID….</p>
  
  <p>What would be the best way in developing this so if it contains specific apps on table2 appsinfo column, it will write it as Yes and if it does not, write no for each ID on the corresponding row?</p>