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 show the cost center id and name in ssrs report

(1) ShareShare
ReportReport
Posted on by 404
Hello,
 
i want to get the cost center id and name on my ssrs report ( purchase requisition)
anyone can provide with the code to make this happen?
thanks
  • Waed Ayyad Profile Picture
    7,902 Super User 2025 Season 1 on at
    How to show the cost center id and name in ssrs report
    Hi,
     
    Did you apply my suggestion and add the select statement? if yes, please verify my answer, if you're still having an issue tell us in order to help you.
     
    Thanks,
    Waed Ayyad
     
     
     
     
  • Suggested answer
    Waed Ayyad Profile Picture
    7,902 Super User 2025 Season 1 on at
    How to show the cost center id and name in ssrs report
    Hi,
     
    I see you don't select the PurchReqLine, You should use select statement or use find method to get the correct record, from your code you are trying to call empty buffer.
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     

  • D365FO DEV Profile Picture
    404 on at
    How to show the cost center id and name in ssrs report
    Hi wael,
     
     i have tried it but its not working. values are blank.
  • Suggested answer
    Waed Ayyad Profile Picture
    7,902 Super User 2025 Season 1 on at
    How to show the cost center id and name in ssrs report
    Hi,
     
    Just set the str _dimName; to be str _dimName = ''CostCenter" and  _rec = Default dimension field from Purch requisition lines table.
     
    DimensionAttributeValueSetStorage dimStorage;
    str _dimName = "CostCenter";// Dimension name
    
    dimStorage = DimensionAttributeValueSetStorage::find(_rec); //default dimension RecId
    
    return dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(_dimName).RecId);
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     
  • D365FO DEV Profile Picture
    404 on at
    How to show the cost center id and name in ssrs report
    Hi Waed,
     
    Pls provide me the exact code based on my case if possible
  • Suggested answer
    Waed Ayyad Profile Picture
    7,902 Super User 2025 Season 1 on at
    How to show the cost center id and name in ssrs report
    Hi,
     
    Check the following code:
    DimensionAttributeValueSetStorage dimStorage;
    str _dimName;// Dimension name
    
    dimStorage = DimensionAttributeValueSetStorage::find(_rec); //default dimension RecId
    
    return dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(_dimName).RecId);
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     
  • D365FO DEV Profile Picture
    404 on at
    How to show the cost center id and name in ssrs report
    hi layan,
     
    they didnt help
  • Layan Jwei Profile Picture
    7,725 Super User 2025 Season 1 on at
  • D365FO DEV Profile Picture
    404 on at
    How to show the cost center id and name in ssrs report
    hi martin,
     
    i still didnt write the code for this one as im facing challenges, so can you provide code that gets me cost center value and name?
    im using an extension on standard dp class in inserting event handler
  • Martin Dráb Profile Picture
    231,925 Most Valuable Professional on at
    How to show the cost center id and name in ssrs report
    Let me repeat my answer to the identical question in your other thread:
     
    I can't, because what code you should write (if any at at all) depends on how you've implemented (or are going to implement) your report or how it's implemented the report you're extending. You may be modifying an AOT query, use the query framework, write a select statement in X++, use electronic report and so on. There is no universal code.
     
    If you have no idea how to design the code, you'll need to tell us more about your report.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,245 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,925 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans