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 324
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 3,904 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 3,904 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 324 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 3,904 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 324 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 3,904 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 324 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 4,815 Super User on at
  • D365FO DEV Profile Picture
    D365FO DEV 324 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 225,864 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans