How to use display method as a range in axapta 3.0 report
I am just wondering if someone could help me please. I am designing a report in Axapta 3.0 and facing a issue. I have got a display method in InventTable which is returning the ON-Hand stock quantity. I am using this in a report to show the quantity of item has not been sold. Now i want to add this method as a range so only the item has quantity more then 5 on hand should be displayed.
I will appreciate any hel开发者_Go百科p regarding this.
Regards,
As I know you cannot use method as range.
Range is a database-side logic. Axapta core converts all ranges to valid SQL and transfer it to database server.
Table method is a AOS (or client) logic. It works on AOS or client. It cannot be converted to SQL and tranfered to database server.
But you can fetch all records from database server and filter them on AOS (or client) in your report code. Just override fetch() or send() method on your report to do it.
Here you can find the example.
Another workaround that doesn't require overwriting the fetch
method. You can try overwriting the executeSection
method (e.g.
\Reports\YourReport\Designs\ReportDesign1\AutoDesignSpecs\Body:YourReportBody\Methods\executeSection
) in the following way:
public void executeSection()
{
InventQty qty = yourMethodToCalculateQty();
;
if (qty > 5)
{
super();
}
}
If the quantity is not greater than 5 the line will be skipped.
精彩评论