Skip to main content

Notifications

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 289
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 2,982 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 2,982 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
     
     

  • 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 2,982 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
     
     
  • 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 2,982 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
     
     
  • How to show the cost center id and name in ssrs report
    hi layan,
     
    they didnt help
  • Layan Jwei Profile Picture
    Layan Jwei 3,447 Super User 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 224,463 Super User 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.

Helpful resources

Quick Links

Can you answer this forum question?

You could make someone's day!

Community Newsletter - May 2024

Kudos to our community stars!

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,623 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 224,463 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans