reports in aot

hello sir\mdam

this is reports


invoiceid

date

taxamount

invoiceamount

101

12-12-2013

105

1250

101

13-12-2013

214

1520

i want add both amount in a 101 id how i can do this
example
invoiceid taxamount invocieamount date
101 319 2770 anyone
i want output this type
thanks and regards
ali

Hi Ali,

Please use display method in the design body section.

And drag and drop that method in the design.

Please also add invoice id in the group by section.

For example:

display Amount SumInvoiceAmount()
{
InvoiceTable invoiceTable;
select sum(InvoiceAmount) from invoiceTable
where invoiceTable.InvoiceId == invoiceTable_1.InvoiceId;

return invoiceTable.InvoiceAmount;
}

same method for invoice date, here i have displayed first date
display TransDate InvoiceDate()
{
InvoiceTable invoiceTable;
select firstonly InvoiceDate from invoiceTable
order by invoiceTable.InvoiceDate
where invoiceTable.InvoiceId == InvoiceTable_1.InvoiceId;

return invoiceTable.InvoiceDate;
}

Thanks,

Hari

In general, you want a query like this: select sum(InvoiceAmount), sum(TaxAmount) from t group by InvoiceId.

The implementation depends on the type of your report. If you say “reports in aot”, do you mean a MorphX report (in AX 2009 or older)? In that case, you can model your query directly in your report (under Data Sources) - add InvoiceId to Group By node and aggregate amounts by right-clicking Fields node, choosing New > SUM and selecting the right field.

Sir this method work properly

but on All id print same amount not different print

example

id amount

101 500

102 500

this type

You’ll have to tell us what you implemented.

Dear martin sir

i want implement different id with different amount but my result show

id taxamount invoiceamount

101 254 6523

102 254 6523

this type

but i want different amount with different id

how

thanks

ali