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

Possible bug with server summary for field from different table

$
0
0
Hi,

SmartGwt Power 4.1. build 2014-10-29 using MSSQL database.

I have a datasource where I join in multiple tables using tableClause:

Code:

<DataSource ID="portlet_summary_contractor_bingo_financial_reporting"       
                serverType="sql"
                tableName="lor_lotteries">
        <fields>
                <field name="lottery_id" nativeName="id" type="sequence"        primaryKey="true" />
                <field name="contractor_orgno" tableName="o" nativeName="orgno"        title="Orgnr entreprenør" type="text" />
                <field name="lottery_valid_from" detail="true" nativeName="valid_from" type="date" title="Bingo dato fra" />
                <field name="lottery_valid_to" detail="true" nativeName="valid_to" type="date" title="Bingo dato til" />
        </fields>

        <operationBindings>

                        <OperationBinding operationType="fetch">
                                <tableClause><![CDATA[
          lor_lotteries
            LEFT OUTER JOIN lor_contractor_approvals c ON lor_lotteries.contractor_approval_id = c.id
            LEFT OUTER JOIN organizations o ON c.organization_id = o.id
        ]]>
                                </tableClause>
                  <summaryFunctions>
                                <lottery_id>count</lottery_id>
                                <contractor_orgno>count</contractor_orgno>
                                <lottery_valid_from>max</lottery_valid_from>
                        </summaryFunctions>
                </OperationBinding>
        </operationBindings>
</DataSource>

When running this query, I get a count of lottery_id and a max of lottery_valid_from. However, I don´t get a result for contractor_orgno.

The reason seems to be that summaries does not work for fields which have the tableName property set.

So, if I add a tableName="or_lotteries" to the lottery_valid_from field definition, I don´t get a summary for this field either.

Is this a bug or is it intended to behave this way?

Regards
Rolf

Viewing all articles
Browse latest Browse all 4756

Trending Articles