Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to show the cost c...
Finance forum
Suggested answer

How to show the cost center id and name in ssrs report

Posted on by 386
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
    Waed Ayyad 5,456 Super User 2024 Season 2 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
    Waed Ayyad 5,456 Super User 2024 Season 2 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
    D365FO DEV 386 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
    Waed Ayyad 5,456 Super User 2024 Season 2 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
    D365FO DEV 386 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
    Waed Ayyad 5,456 Super User 2024 Season 2 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
    D365FO DEV 386 on at
    How to show the cost center id and name in ssrs report
    hi layan,
     
    they didnt help
  • Layan Jwei Profile Picture
    Layan Jwei 7,071 Super User 2024 Season 2 on at
  • D365FO DEV Profile Picture
    D365FO DEV 386 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
    Martin Dráb 228,501 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans