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 :
Finance | Project Operations, Human Resources, ...
Answered

DataMemberAttribute for labeling in report contract class

(0) ShareShare
ReportReport
Posted on by

Hi all,

When creating Contract Class, I usually using this kind of parameter code :

[ DataMemberAttribute,
SysOperationLabelAttribute("Created from date"),
SysOperationDisplayOrderAttribute('1')
]
public transdate parmfromdate(Transdate _fromdate = fromdate)
{
fromdate = _fromdate;
return fromdate;
}

In the DataMemberAttribute, what is actually the difference by adding some word or leave it empty like that ? because it used to be like this ->

[ DataMemberAttribute("FromDate"),
SysOperationLabelAttribute("Created from date"),
SysOperationDisplayOrderAttribute('1')
]
public transdate parmfromdate(Transdate _fromdate = fromdate)
{
fromdate = _fromdate;
return fromdate;
}

Reason I asked is, I gotta an issue whereby the label showing when running this, is not correct, and I fixed it by changed the SysOperationLabelAttribute (I added the word 'Created' before there is no such word), but it is never reflected after Build. Some guy advice me to just leave the DataMemberAttribute to empty like the 1st one, and the label changes is reflected. BUT STRANGELY, the dialog now give me extra one parameter which has the old label, right at the end of my parameters.

How to fix this problem ?

I have the same question (0)
  • Verified answer
    Blue Wang Profile Picture
    Microsoft Employee on at

    HI WWwong,

    After you add label or change DataMemberAttribute to empty, did you refresh your dataset and deploy report again?

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi WWwong,

    Data contract class is used to exchange data between 2 entities (client and service for examples) by serialization and deserialization of contract class to a common format (json, xml).

    DataMemeberAttribute has one optional parameter Name, to indicate the name of the member in serialization\deserialization process. If it's empty name of the method name will be taken (without parm).

    When SSRS report generates parameters for the report object itself, it uses a contract to do it. If some parameters were changed the contract after you need to reflect these changes to SSRS report parameters as well, but refreshing data set.

    if you rename parm method (like parmTransDate -> parmFromDate) you can add custom name via DataMemberAttribute class to keep the old name and do not refresh SSRS report dataset.

    In your case, you can try to remove the custom name and refresh SSRS report dataset and check final list of parameters of data set.

  • Community Member Profile Picture
    on at

    Hi Blue,

    No, it's not about the report, but the Dialog parameter it self.

    So now, I have two Dialog field parameter instead one, 1st is with the correct labelling, and at the very end (because I have other parameters too, specified in this Report Contract Class), is the old with incorrect (old) labelling that come from nowhere.

    Thanks,

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi WWwong,

    Check your parameters, It is bound to the label.

    11215.PNG

  • Community Member Profile Picture
    on at

    Hi Both,

    Yeah, never occurred to me that it is bound to the report. Thought it is a UI problem. I refresh (restore) dataset, also checking the parameters. Saw that two "old" parameters then delete (I can just delete, right ?), build and deploy again.

    It works.

    Thank you so much.

  • Blue Wang Profile Picture
    Microsoft Employee on at

    hi Wwwong,

    Yes, you can delete the parameters that do not exist in the data set.

    Because you set the label, so it is not only a problem of the UI.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 613

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 292 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans