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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to LedgerDimension of Cost Accounts under Project Categories through x++

(0) ShareShare
ReportReport
Posted on by

Hi ,

I need to export the Followings to Excel.

Category ID, Category name, Category group, Cost account  under Project Categories.

I stuck with Cost Account,  they are segmented entries .  

Please let me know how could I do this.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Microsoft Mania,

    In AX2012 each project has a cost control form.

    This form includes an enhanced Excel Export functionality.

    It does not include the category group and category name though but maybe it is a quickly available and cheap alternative to build something new.

    Best regards,

    Ludwig

    8765.2.png

    8765.2.png

  • Community Member Profile Picture
    on at

    Thank you Ludwig,

    Could you please let me know from where to open the form please ?

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Just navigate to any project that has some transactions posted.

    Open the control tab and somewhere on the left is the 'cost control' button that opens this form.

    Best regards,

    Ludwig

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please use the following job to export project category data.

    static void ProjectCategory(Args _args)

    {

       CategoryTable                       categoryTable;

       ProjCategory                        projCategory;

       ProjPosting                         projPosting;

       DimensionAttributeValueCombination  dimensionComb;

       SysExcelApplication                 excel;

       SysExcelWorkbooks                   workbooks;

       SysExcelWorkbook                    workbook;

       SysExcelWorksheets                  worksheets;

       SysExcelWorksheet                   worksheet;

       SysExcelCells                       cells;

       SysExcelCell                        cell;

       int                                 row;

       excel = SysExcelApplication::construct();

       workbooks = excel.workbooks();

       workbook = workbooks.add();

       worksheets = workbook.worksheets();

       worksheet = worksheets.itemFromNum(1);

       cells = worksheet.cells();

       cells.range('A:A').numberFormat('@');

       excel = SysExcelApplication::construct();

       workbooks = excel.workbooks();

       workbook = workbooks.add();

       worksheets = workbook.worksheets();

       worksheet = worksheets.itemFromNum(1);

       cells = worksheet.cells();

       cells.range('A:A').numberFormat('@');

       row++;

       cell = cells.item(row, 1);

       cell.value("CategoryId");

       cell = cells.item(row, 2);

       cell.value("CategoryName");

       cell = cells.item(row, 3);

       cell.value("Category group");

       cell = cells.item(row, 4);

       cell.value("Cost Account");

       while select categoryTable

       join projCategory

       where categoryTable.CategoryId == projCategory.CategoryId

       join projPosting

       where projPosting.ProjFundingSource == 0

       && projPosting.ProjAccountType == ProjAccountType::CostAccount

       && projPosting.ProjCode == TableGroupAll::All

       && projPosting.ProjRelation == ""

       && projPosting.CategoryCode == TableGroupAll::Table

       && projPosting.ProjCategoryRelation == categoryTable.CategoryId

       join dimensionComb

       where dimensionComb.RecId == projPosting.LedgerDimension

       {        

           cell = cells.item(row + 1, 1);

           cell.value(categoryTable.CategoryId);  // CategoryId

           cell = cells.item(row + 1, 2);

           cell.value(categoryTable.CategoryName); // CategoryName

           cell = cells.item(row + 1, 3);

           cell.value(projCategory.CategoryGroupId); // Category group

           cell = cells.item(row + 1, 4);

           cell.value(dimensionComb.DisplayValue); // Cost Account

           row++;

       }

       excel.visible(true);

    }

    Thanks,

    Chaitanya Golla

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans