web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to customize standard report?

(0) ShareShare
ReportReport
Posted on by 932

Hello, 

I want to modify the standard report "InventOnHand"

I want to add new column in this report.

1. I add new class extension of standard class"inventOnHandDP"

2. i add new method in this class "processReport" and insertTmpTable.

[ExtensionOf(classStr(InventOnhandDP))]
final public class ILBInventOnHandDP_Extension
{
    private void insertTmpTableCus(InventSum _inventSum, InventDim _inventDim)
    {
        ILBReleasedProductMaterial      ilbReleasedProductMaterial;
        InventOnhandTmp                 inventOnHandSelected;
        InventIAvailability inventAvailability = InventAvailabilityProvider::findBySumDim(_inventSum, _inventDim).parmInventAvailability();
        while select MaterialDesc from ilbReleasedProductMaterial where ilbReleasedProductMaterial.ProductNumber == _inventSum.ItemId
        {
            select RecId from inventOnHandSelected where inventOnHandSelected.ItemId == _inventSum.ItemId 
                                                   &&    inventOnHandSelected.MaterialDescription == ilbReleasedProductMaterial.MaterialDesc;
            if(!inventOnHandSelected)
            {
                inventOnhandTmp.ItemId              = _inventSum.ItemId;
                inventOnhandTmp.MaterialDescription = ilbReleasedProductMaterial.MaterialDesc;
                inventOnhandTmp.Deducted            = _inventSum.Deducted;
                inventOnhandTmp.Ordered             = inventAvailability.ordered();
                inventOnhandTmp.PostedQty           = _inventSum.PostedQty;
                inventOnhandTmp.Received            = _inventSum.Received;
                inventOnhandTmp.AvailOrdered        = inventAvailability.availTotal();
                inventOnhandTmp.AvailPhysical       = inventAvailability.availPhysical();
                inventOnhandTmp.ReservOrdered       = inventAvailability.reservOrdered();
                inventOnhandTmp.ReservPhysical      = inventAvailability.reservPhysical();
                // Fields might not have been selected on the specified buffers, or might have been updated since selection
                _inventDim.checkInvalidFieldAccess(false);
                inventOnhandTmp.InventDimFieldsMap::initAllDimensionsFrom(_inventDim);
                inventOnhandTmp.insert();
            }          
        }        
    }

    /// 
    /// Processes the report business logic.
    /// 
    /// 
    /// Provides the ability to write the report business logic. This method will be called by  at runtime.
    /// The method should compute data and populate the data tables that will be returned to .
    /// 
    public void processReportCus()
    {
        InventDim                   inventDim;
        InventDimParm               inventDimParmCriteria;

        InventDimViewContract dimContract = this.parmDataContract() as InventDimViewContract;

        InventDimParm inventDimParm = dimContract.parmInventDimParm();
        inventDimParm.ItemIdFlag            = NoYes::Yes;

        inventDimParmCriteria.ClosedFlag    = NoYes::No;

        Query query = InventSum::newQuery(this.parmQuery(), '', null, inventDimParmCriteria, inventDimParm);
        QueryRun queryRun = new QueryRun(query);
        inventOnhandTmp.setConnection(this.parmUserConnection());       
        while (queryRun.next())
        {
            InventSum inventSum = queryRun.get(tableNum(InventSum));

            if (InventTable::find(inventSum.ItemId).inventItemType().mustInventBeControlled())
            {
                inventDim = queryRun.get(tableNum(InventDim));
            }
            if (!InventTable::find(inventSum.ItemId).inventItemType().isServiceItem())
            {
                this.insertTmpTableCus(inventSum, inventDim);
                inventDim.clear();
            }
        }
    }

}

3. I duplicate the report "inventOnHand"

4. I want to modify the precision design, But I don't find it 

pastedimage1631874024586v1.png

How can I modify this table to add new column in report.

I have the same question (0)
  • Suggested answer
    Pete Alberts Profile Picture
    3,542 on at

    Hi Basma

    Add your field to that report "table". You are correct in saying that there is no precision design.

    Screenshot-2021_2D00_09_2D00_17-at-12.54.23.png

    You can also drag your new field from the dataset into the table.

    Kind regards

  • BASMA Profile Picture
    932 on at

    thanks for reply, 

    but the field exist in table : 

    pastedimage1631876490364v1.png

    but doesn't appear in the report

    pastedimage1631876844984v2.png

  • Pete Alberts Profile Picture
    3,542 on at

    Are you sure it is your report that is printing?

    You'll need to create an extension of the output menu item:

    Screenshot-2021_2D00_09_2D00_17-at-14.21.13.png

  • BASMA Profile Picture
    932 on at

    I create an extension of the output menuItem , but the same issue

    pastedimage1631881875352v1.png

  • Pete Alberts Profile Picture
    3,542 on at

    Then your report is not deploying or there is some sort of report server issue. There are various tedious things you can try and none of them are guaranteed to solve the problem: Restart the report server, restart VS, restart IIS, restart your VM.

    Good luck :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans