0 Replies Latest reply on Apr 28, 2007 7:53 PM by silviasalsa

    I wish to run a combinations of queries based on check boxes checked by the users.

    silviasalsa Level 1
      Hello,

      i want to add this to my original application.
      I wish to run a combinations of queries based on check boxes checked by the users.

      for example: here are the combinations of the queries.

      how can i do this.? is there a sample code?

      <!----select
      tabTee.CEEnum,
      tabTee.Plot,
      tabTee.SEEDEE
      FROM
      tabTee

      where CEEnum like "%pop%"
      and
      SEEDEE = 240---->

      <!----select
      tabTee.CEEnum,
      tabTee.Plot,
      tabTee.SEEDEE
      FROM
      tabTee
      ---->

      <!----
      tabTee.CEEnum,
      tabTee.Plot,
      tabTee.SEEDEE
      FROM
      tabTee
      where CEEnum like "%lol%"
      and
      SEEDEE = 250--------->

      <!----
      tabTee.CEEnum,
      tabTee.Plot,
      tabTee.SEEDEE
      FROM
      tabTee
      where CEEnum like "%non%"
      and
      SEEDEE = 260-----


      <!----Original application
      <!--------------------
      here is the first page where the user selects
      html
      pdf
      escel/csv----------then it goes to a action page act_lop.cfm ---------------

      <h1>LOP Reports </h1>
      <div align="center">
      <form name="theForm" action="act_lop.cfm" method="post"><BR />
      Sorted by:  
      <select name="Orderby" size="1">
      <option value="CEEnum">CEE num</option>
      <option value="Plot">plot No</option>
      </select>
      <br />
      <br />
      Output Format:
      <input type="radio" name="outputFormat" value="HTML" checked="checked" />
      HTML  
      <input type="radio" name="outputFormat" value="PDF" />
      PDF  
      <input type="radio" name="outputFormat" value="CSV" />
      Download/Open Excel Spreadsheet <BR />
      <br />
      <input name="Submit" type="Submit" value="Generate Report" />
      <BR />
      <BR />
      <BR />
      </form>
      </div>

      </body>
      </html>



      <!--------- act_lop.cfm the action page. Html and pdf is working ok but the problem is the excel sheet. --------------

      <cfquery name="getlop" datasource="oracdb10">
      select
      tabTee.CEEnum,
      tabTee.Plot,
      FROM
      tabTee

      ORDER BY

      <cfswitch expression="#Form.orderBy#">
      <cfcase value="CEEnum">
      tabTee.CEEnum
      </cfcase>
      <cfcase value="Plot">
      tabTee.Plot
      </cfcase>
      </cfswitch>


      </cfquery>


      <!---html report--->
      <cfswitch expression="#Form.outputFormat#">
      <cfcase value="HTML,PDF">

      <cfsavecontent variable="htmlData">
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>lop</title>
      </head>
      <style type="text/css">

      td{
      font-family:Arial, Helvetica, sans-serif;
      font-size:12px;
      }
      th{
      font-family:Arial, Helvetica, sans-serif;
      font-size:12px;
      font-weight:bold;
      background-color:#FFFF99;
      }
      h2{
      font-family:Arial, Helvetica, sans-serif;
      font-size:14px;
      }
      h3{
      font-family:Arial, Helvetica, sans-serif;
      font-size:15px;
      }
      </style>

      <body>
      <cfoutput>
      <table border="0" cellpadding="3" cellspacing="0">
      <tr>

      <td align="center">
      <h3>lop</h3><br><br></td>
      </tr>
      <tr>
      <td align="center">
      </h2>Your report returned #getlop.RecordCount# records</h2></td>
      </tr>
      <tr>
      <td>
      <table border="2" cellpadding="2" cellspacing="0">
      <tr>
      <th>Record Number</th>

      <th width="120">CEE num</th>
      <TH>plot No</TH>

      </tr>

      <cfloop query="getlop">


      <tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">
      <td>#CurrentRow#</td>

      <Td>#CEEnum#</td>

      <td>#Plot#</td>





      </tr>
      </cfloop>

      </table>
      </td>
      </tr>
      </table>

      </BODY>
      </HTML>
      </cfoutput>
      </cfsavecontent>

      <cfswitch expression="#Form.outputFormat#">

      <cfcase value="HTML">
      <cfoutput>
      #htmldata#
      </cfoutput>
      </cfcase>
      <cfcase value="PDF">
      PDF
      <cfdocument format="pdf">
      <cfoutput>
      #htmldata#
      </cfoutput>
      </cfdocument>
      </cfcase>

      </cfswitch>





      </cfcase>

      <cfcase value="CSV">


      <CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=lop.csv">
      <cfcontent type="application/msexcel">"Cee Num","plot No"
      <cfoutput query="getlop"> #ltrim(CeeNum)#, #PLOT#
      </cfoutput>

      <cfabort>
      </cfcase>
      </cfswitch>---------->