Thanks Nick, but my problem is extremely complicated.

Here we go.

In the first page, the user has the option to select from around 15 options 
(checkboxes) that will generate anywhere from 1 to 60 columns of data in the 
action page.  Additionally, I have a select list that can define the rows in 
four possible ways, one of which uses ListQualify(FORM.SelectLib,"'") for 
multiple selections.

As you can imagine, there are many <cfif> tags on the action page that control 
which of 8 queries are executed with whatever variables.

So, what I need to do is find out how to store the form values so that they can 
be sent back to the action page with the selected sort option.  After looking 
around, I've found out that it is possible to store the form values in the 
session.

However, knowing that it's possible is a whole lot different than doing it.  
Could anyone give me an idea how to start?

A sample of one part of the code is below:

Thanks in advance,

John


<!---CFPARAMS apply to both group and Individual methods--->
<!---Includes ENROLLMENT--->
<cfparam name="FORM.enrollment" default="false">

<!---Applies to INDIVIDUAL/MULTI SELECT choices--->
<cfif FORM.selectLib LT '200'>
<cfset SelLib = ListQualify(FORM.SelectLib,"'")>

<!---Begin Collection Data Selections--->
<cfparam name="FORM.allColl" default="false">
<cfif FORM.allColl IS "True">
<!---Selects All Collection data--->
        <cfparam name="FORM.cntAv" default="true">
        <cfparam name="FORM.cntPrint" default="true">
        <cfparam name="FORM.cntEbook" default="true">
        <cfparam name="FORM.addedAv" default="true">
        <cfparam name="FORM.addedPrint" default="true">
        <cfparam name="FORM.addedEbook" default="true">
        <cfparam name="FORM.discAv" default="true">
        <cfparam name="FORM.discPrint" default="true">
<cfelse>
<!---Creates individual data selections--->
        <cfparam name="FORM.allColl" default="false">
        <cfparam name="FORM.cntAv" default="false">
        <cfparam name="FORM.cntPrint" default="false">
        <cfparam name="FORM.cntEbook" default="false">
        <cfparam name="FORM.addedAv" default="false">
        <cfparam name="FORM.addedPrint" default="false">
        <cfparam name="FORM.addedEbook" default="false">
        <cfparam name="FORM.discAv" default="false">
        <cfparam name="FORM.discPrint" default="false">
</cfif>
<!---Sets application--->
<cfobject component="#application.cfcpath#admin_report" name="admrep">
        <cfinvoke component="#admrep#"
                          method="getCollDataLib"
                          returnvariable="qGetCollData">

                <cfinvokeargument name="libCode"
                                                  value="#selLib#">
        </cfinvoke>
</cfif>


<!---THE QUERY FROM CFC--->
<cfcomponent>
<!---Get Collection Data for Indiv and Multi-Selections--->
        <cffunction name="getCollDataLib" 
                                returntype="query" 
                                hint="FOR INDIVIDUAL AND MULTI-SELECT 
LIBRARIES">
                <cfargument name="Libcode"
                                    type="string">
                <cfquery name="qGetCollData" 
datasource="#APPLICATION.datasource#">
                
                
                SELECT l.libId,
                           l.library,
                           l.librarian,
                           aa.AddAvTotal,
                           ap.AddPTotal,
                           ae.AddEbTotal,
                           ca.cntAvTotal,
                           cp.TotalPrint,
                           ce.TotalEbook,
                           da.disAvTotal,
                           dp.disPTotal,
                           en.popTotal

                FROM  ((((((((Library l INNER JOIN
                          addedAv aa ON l.libid = aa.libid) 
                          INNER JOIN AddedPrint ap ON l.libid = ap.libid)
                          LEFT OUTER JOIN addedEbook ae ON l.libid = ae.libid) 
                          INNER JOIN countAv ca ON l.libid = ca.libid) 
                          INNER JOIN countPrint cp ON l.libid = cp.libId)
                          INNER JOIN countEbook ce ON l.libid = ce.libid)
                          LEFT OUTER JOIN discardAv da ON l.libid = da.libid)
                          INNER JOIN enrollment en ON l.libid = en.libid)
                          LEFT OUTER JOIN discardPrint dp ON l.libid = dp.libid
                WHERE l.libid IN  (#preserveSingleQuotes(ARGUMENTS.libCode)#)
                ORDER BY l.library
                </cfquery>
                <cfreturn qGetCollData>
        </cffunction>

<!---THE TABLE FROM THE ACTION PAGE--->
<table cellpadding="1" cellspacing="1">
<tr>
<th>Library</th>
<th>Enroll</th>
<cfif FORM.addedAv IS "True"><th>AV <br />Added</th></cfif>
<cfif FORM.addedPrint IS "True"><th>Print <br />Added</th></cfif>
<cfif FORM.addedEbook IS "True"><th>EBooks <br />Added</th></cfif>
<cfif FORM.discAv IS "True"><th>AV <br />Discard</th></cfif>
<cfif FORM.discPrint IS "True"><th>Print <br />Discard</th></cfif>
<cfif FORM.cntAv IS "True"><th>AV <br />Total</th></cfif>
<cfif FORM.cntPrint IS "True"><th>Print <br />Total</th></cfif>
<cfif FORM.cntEbook IS "True"><th>Ebook <br />Total</th></cfif>
<cfif FORM.cntItemsTotal IS "True"><th>Total<br />Items</th></cfif>
<cfif FORM.enrollment IS "TRUE"><th>Items /<br />Student</th></cfif>
</tr>
<cfloop query="qGetCollData">
<cfset class = iif(qGetCollData.currentRow mod 2 eq 0, "'DataA'", "'DataB'")>
<cfoutput>
<tr>
<td class="#class#">#library#</td>
<td class="#class#">#popTotal#</td>
<cfif FORM.addedAv IS "True"><td class="#class#">#AddAvTotal#</td></cfif>
<cfif FORM.addedPrint IS "True"><td class="#class#">#AddPTotal#</td></cfif>
<cfif FORM.addedEbook IS "True"><td class="#class#">#AddEbTotal#</td></cfif>
<cfif FORM.discAv IS "True"><td class="#class#">#DisAvTotal#</td></cfif>
<cfif FORM.discPrint IS "True"><td class="#class#">#DisPTotal#</td></cfif>
<cfif FORM.cntAv IS "True"><td class="#class#">#cntAvTotal#</td></cfif>
<cfif FORM.cntPrint IS "True"><td class="#class#">#TotalPrint#</td></cfif>
<cfif FORM.cntEbook IS "True"><td class="#class#">#TotalEBook#</td></cfif>
<cfif FORM.cntItemsTotal IS "True"><td class="#class#">#numberFormat(TotalEBook 
+ TotalPrint + cntAvTotal,"0,000")#</td></cfif>
<cfif FORM.enrollment IS "True"><td class="#class#">#numberFormat((TotalEbook + 
TotalPrint + cntAvTotal)/(popTotal),"0.00")#</td></cfif>
</tr>
</tr>
</cfoutput>
</cfloop>
</table>


>Well - here is what I have done.  It can certainly cleaned up - but I
>haven't gotten to it. (Maybe a project for today.)
>
>This one allows sorting by "Term" - or "letter" As well as Column Name ASC
>and DSC (It allows me to get only Last Names starting with "x" and sort that
>by whatever, email, added, posts, etc.)
>
><cfquery name="qryGetEmailSubscribers" datasource="#datasource#"
>username="#username#" password="#password#">
>SELECT EmailSubscribers.*
>FROM EmailSubscribers
>
>       <cfif IsDefined("URL.Term") AND #URL.Term# NEQ "">
>               WHERE LastName Like "#URL.Term#%"
>                       <cfif IsDefined("URL.SORT")>
>                               ORDER BY #URL.SORT# #URL.Order#
>                       <cfelse>
>                               ORDER BY LastName ASC
>                       </cfif>
>       <cfelse>
>                       <cfif IsDefined("URL.SORT")>
>                               ORDER BY #URL.SORT# #URL.Order#
>                       <cfelse>
>                               ORDER BY LastName ASC
>                       </cfif>
>       </cfif>
>
></cfquery>
>
>Example  Links:
>So for the term letters  - I list each letter of the alphabet and link as
>follows:
><a href="#CurrentPage#?Term=d">D</a>
>
>For the each of the Column Heads I want to sort I have the following:
>
><th><a href="email_subscribers_list.cfm?Sort=LastName&Order=<cfif
>IsDefined("URL.Order") AND URL.Order EQ "ASC">DESC<cfelse>ASC</cfif><cfif
>IsDefined("URL.Term")>&Term=<cfoutput>#URL.Term#</cfoutput></cfif>" ><font
>color="#333333">Name</font><cfif ISDefined("URL.Sort") AND URL.Sort EQ
>"LastName"><cfif URL.Order EQ "ASC"><img src="images/icon_sort_asc.gif"
>border="0"><cfelse><img src="images/icon_sort_desc.gif"
>border="0"></cfif></cfif></a></th>
>
>
>As I said - it can use some simplifying - but it works and should give you a
>start.
>
>- Nick 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2971
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to