Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / DP class apply ranges ...
Finance forum
Unanswered

DP class apply ranges but the Report doesn't get affected!

Posted on by 49
I made a DP class and controller class and the query attribute above DP class to make Records to include tab appear in the report Dialog.
The problem is: when I add some values in the query filter and debug the DP class I find those ranges are applied to the query
but the actual Report shows all fields without any filters! 
 
 
this is DP Class: 
[SRSReportQueryAttribute(queryStr(OnHandListQuery))]
class ADCOnHandListReportDP extends SRSReportDataProviderBase
{
    OnHandListTmp    onHandListTmp;

    [SRSReportDataSetAttribute(tableStr(OnHandListTmp))]
    public OnHandListTmp getOnHandListTmp()
    {
        select onHandListTmp;
        return onHandListTmp;
    }

    public void processReport()
    {
        
        Query							 q = this.parmQuery();
        QueryRun					     qr = new QueryRun(q);


        while(qr.next())
        {
            InventSum                        inventSumRecord = qr.get(tableNum(InventSum));
            InventDim                        inventDimRecord = qr.get(tableNum(InventDim));
            InventTable                      inventTableRecord = qr.get(tableNum(InventTable));

            onHandListTmp.clear();
            onHandListTmp.ItemId             = inventSumRecord.ItemId;
            onHandListTmp.ItemName           = inventSumRecord.itemName();
            onHandListTmp.UnitId             = inventSumRecord.inventUnitId(inventSumRecord);
            onHandListTmp.InventLocationId   = inventDimRecord.InventLocationId;
            onHandListTmp.ItemGroupId        = inventTableRecord.itemGroupId();
            onHandListTmp.PhysicalInventory  = inventSumRecord.physicalInventCalculated();
            onHandListTmp.insert();
        }
    }
}
and this is Controller Class:
class ADCOnHandListReportController extends SrsReportRunController
{
    public static ADCOnHandListReportController construct()
    {
        return new ADCOnHandListReportController();
    }

    public static void main(Args _args)
    {
        ADCOnHandListReportController controller = ADCOnHandListReportController::construct();

        controller.parmArgs(_args);
        controller.parmReportName(ssrsReportStr(ADCOnHandListClassReport,PrecisionDesign1));
        controller.startOperation();
    }
}
This is the query value when I debug:
as you see the ranges are included but the result report doesn't show the values depending on this query!
SELECT dataAreaId, InventDimId, Deducted, InventLocationId, ItemId, Ordered, Picked, PostedQty, Received, Registered 
FROM InventSum(InventSum) 
WHERE ((InventLocationId = N'10101101')) 
JOIN dataAreaId, ItemId, ItemType, NameAlias 
FROM InventTable(InventTable) 
ON InventSum.ItemId = InventTable.ItemId 
AND InventSum.dataAreaId = InventTable.dataAreaId 
JOIN dataAreaId, inventDimId, InventLocationId 
FROM InventDim(InventDim) 
ON InventSum.InventDimId = InventDim.inventDimId 
JOIN ItemId, ModuleType, UnitId 
FROM InventTableModule(InventTableModule) 
ON InventSum.ItemId = InventTableModule.ItemId 
AND InventSum.dataAreaId = InventTableModule.dataAreaId 
AND ((ModuleType = 0))
 
  • Martin Dráb Profile Picture
    Martin Dráb 228,177 Most Valuable Professional on at
    DP class apply ranges but the Report doesn't get affected!
    You're welcome. :-)
  • AbdullahAhmed_ Profile Picture
    AbdullahAhmed_ 49 on at
    DP class apply ranges but the Report doesn't get affected!
    I don't know what to say but I thought that the table I was using is TempDB table but when I checked out it was Regular table.. and when I changed it to TempDB it worked as expected.
     
    Thank you, Martin.. You're a big help to me and the community.
  • Martin Dráb Profile Picture
    Martin Dráb 228,177 Most Valuable Professional on at
    DP class apply ranges but the Report doesn't get affected!
    Which type of table are you using? A regular one, or temporary? If temporary, which one? InMemory or TempDB? Do you know how to verify the data in the table?
  • AbdullahAhmed_ Profile Picture
    AbdullahAhmed_ 49 on at
    DP class apply ranges but the Report doesn't get affected!
    I'll try to be more clear.. The records get inserted in OnHandListTmp table in processReport method, when I debug this method there are 35 records inserted which is the desired result... but the final result in the report is more than 4000 pages with all the records in the system!
     
    What am I missing? The  OnHandListTmp table has only 35 records and then I don't know they are all gone and the entire data in the system is retrived!! where does it come from? what makes a call to get all these data?!
  • Martin Dráb Profile Picture
    Martin Dráb 228,177 Most Valuable Professional on at
    DP class apply ranges but the Report doesn't get affected!
    As I said, if wrong data was inserted to OnHandListTmp table, it means that the problem is in your RDP class, not the report. The RDP class is where you insert the records. If you have no idea what's wrong with your RDP class, the debugger will tell you more.
  • AbdullahAhmed_ Profile Picture
    AbdullahAhmed_ 49 on at
    DP class apply ranges but the Report doesn't get affected!
    This is the report:
     
     
     
    and this is the results from the query in sql server:
    It shows 35 Records..
     
     
    and when I debug my DP class there are 35 records inserted in OnHandListTmp table with the same data in SQL Server! 
     
  • Martin Dráb Profile Picture
    Martin Dráb 228,177 Most Valuable Professional on at
    DP class apply ranges but the Report doesn't get affected!
    If the data source of your report is OnHandListTmp table, you must be saying that your RDP class inserts wrong records to this table. The query is used just in the RDP class, not by the report itself. Please debug your RDP class to see what's going on.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,339 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,177 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans