Creating a ColdFusion function to handle the report outputs based on the varieties of 10 groupings. The output shows data grouping and amounts correctly, but it doesn't have correct report heading. For instance, it should have 5 different building names shown for each group, but all have the same building name.
Here is the code that calling the function:
<cfoutput query="Output" group="#Group1Field#" >
<cfscript>
Group1Count = 0;
Group1Amount = 0;
</cfscript>
<h2>#eqInventoryHelper.getGroupingHeaderText(Group1, Output)#</h2></cfoutput>
Here is the code from the function:
<cffunction name="getGroupingHeaderText" output="false">
<cfargument name="selectedGrouping" required="true" type="string"/>
<cfargument name="outputQuery" required="true" type="query"/>
<cfscript>
var result = "";
switch (arguments.selectedGrouping) {
case "Building" :
result = "Building: #arguments.outputQuery.building_code# - #arguments.outputQuery.building_name#";
break;
case "PI Name" :
result = "PI: #arguments.outputQuery.pi_name#";
break;
case "Custodial Code" :
result = "Custodial Code: #arguments.outputQuery.custodial_code# - #arguments.outputQuery.custodian_desc#";
break;
case "Manufacturer" :
result = "Manufacturer: #arguments.outputQuery.manufacturer_name#";
break;
case "Room Number" :
result = "Room Number: #arguments.outputQuery.building_room_number#";
break;
case "Current UC Fund" :
result = "Current UC Fund : #arguments.outputQuery.cur_uc_fnd#";
break;
case "Original UC Fund" :
result = "Original UC Fund: #arguments.outputQuery.orig_uc_fnd#";
break;
case "EFA Fund Source" :
result = "EFA Fund Source: #arguments.outputQuery.efa_fnd_src_cd#";
break;
case "Asset Status" :
result = "Asset Status: #arguments.outputQuery.asset_status_name#";
break;
}
return result;
</cfscript>
</cffunction>
Any suggestion?
Thanks.