Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Filter based on the Grid summary

$
0
0
I have a set of records in my listgrid. Each records has unique item number(combination of 5 items numbers) with OH Units field.
I am using both filter and Group by option. Initially I am using a Group by where the OH Units is summed up to its group value

Eg., Before Grouping

Item Number OH Units
001-051-061-071-001 100
001-051-061-071-002 200
001-051-061-071-003 400

After Group by first four combinations, I get the below result.
Item Number OH Units
001-051-061-071 700

Case 1 : While applying filter for OH units > 650.
It shows no items to display

Case 2 : While applying filter for OH units > 350.
It shows only one record to display
Item Number OH Units
001-051-061-071-003 400

Case 2 : While applying filter for OH units > 90.
Item Number OH Units
001-051-061-071 700

I want filtering to be based on summary values shown below the grid and not on individual records.

Below is the query used for fetching the records. Based on the count value from the query the records are being displayed in the grid.

<operationBinding operationType="fetch" operationId="count">
<selectClause>count(*) as recordCount</selectClause>
<tableClause>
<![CDATA[
(select 1 as aGroup from
#if($isMultiBusinessFeatureEnabled)
IPITHDR JOIN IPIZHDR
ON IPIZHDR.IZONE=$zone AND IPITHDR.ICLS=IPIZHDR.ICLS AND IPITHDR.IVEN=IPIZHDR.IVEN
AND IPITHDR.ISTY=IPIZHDR.ISTY AND IPITHDR.ICLR=IPIZHDR.ICLR AND IPITHDR.ISIZ=IPIZHDR.ISIZ
#else IPITHDR #end

WHERE ($defaultWhereClause)
#if($rawValue.ItiuValue)
$rawValue.itiuclause

#if ($ViewRestrictedItems != "true" && $rawValue.restrictedItemsClause)
AND NOT ($rawValue.restrictedItemsClause)

#end

GROUP BY
#if ($GroupLevel == "style")
IPITHDR.ICLS, IPITHDR.IVEN, IPITHDR.ISTY, CASE WHEN IPITHDR.IPPK='Y' THEN 'Y' ELSE 'N' END
#elseif ($GroupLevel == "color")
IPITHDR.ICLS, IPITHDR.IVEN, IPITHDR.ISTY, IPITHDR.ICLR, CASE WHEN IPITHDR.IPPK='Y' THEN 'Y' ELSE 'N' END
#elseif ($GroupLevel == "item")
IPITHDR.ICLS, IPITHDR.IVEN, IPITHDR.ISTY, IPITHDR.ICLR, IPITHDR.ISIZ, CASE WHEN IPITHDR.IPPK='Y' THEN 'Y' ELSE 'N' END
#else ''
#end
) as work
]]>
</tableClause>
<whereClause>1 = 1</whereClause>
<groupClause>aGroup</groupClause>
</operationBinding>

I tried using addToTemplateContext for appending the condition from server side as a string. But got parsing error. Any suggestions ?

Viewing all articles
Browse latest Browse all 4756

Trending Articles