Suppose you have a parm method in contract class ‘MyContractClass’ say ‘parmTestMethod’ and you have set the label for the field as shown below:

SysOperationLabelAttribute(literalstr(“@SYS123”))

Now, you want to the change the label displayed on the report dialog for this field, based on the specific configuration key is enabled or not. Here is the way to do this:

Create a UIBuilder class extends from SRSReportDataContractUIBuilder, if one isn’t there and override the postBuild method. Write the following code in the postBuild method:

DialogField        dialogField;

MyContractClass    contract;

super();

contract = this.dataContractObject();

dialogField = this.bindInfo().getDialogField(contract, methodstr(MyContractClass, parmTestMethod));

if (isConfigurationkeyEnabled(configurationKeyNum(ConfigKeyName)))  // Replace the config key name with the name which you want to use here.

{

dialogField.label(literalstr(“@SYS123”));

}

else

{

dialogField.label(literalstr(“@SYS456”));

}

Advertisements