Following are the two steps required if you want to add a validation on SSRS report dialog form or want to make a specific field mandatory for a report:
1. Implement the contract class by SysOperationValidatable
public class ProjTransReportContract implements SysOperationValidatable
2. Add the validate method
public boolean validate()
{
boolean isValid = true;
;
if (this.parmFiscalYear() == '')
{
// Fiscal year was not entered.
isValid = checkFailed(strfmt("The fiscal year is required. Enter a defined fiscal year to continue."));
}
else if (this.parmProjId() == '')
{
// Project ID was not entered.
isValid = checkFailed(strfmt("The Project Id is required. Enter a defined Project Id to continue."));
}
return isValid;
}
Wonderful example
ReplyDelete