Sometimes customer has requirement to have the specific design changes on report/parameter dialog, we came across one of such requirements to have all report parameters in one column of the dialog. This can be achieved with code of couple of lines in build method of UI builder class.
Here’s a code sample demonstrating how this can be done:
/// <summary>
/// UI builder class for managing report control
/// </summary>
class Demo_ReportUIBuilder extends SrsReportDataContractUIBuilder
{
DialogField dialogField1;
DialogField dialogField2;
/// <summary>
/// Overriden method to handle the report dialog controls
/// </summary>
public void build()
{
super();
dialogField1 = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(Demo_ReportContract, parmField1));
//Set as mandatory
dialogField1.fieldControl().mandatory(true);
dialogField2 = this.bindInfo().getDialogField(this.dataContractObject(),methodStr(Demo_ReportContract, parmField2));
//Code to arrange fields in one column -
SysOperationDialog dlg = dialog as SysOperationDialog;
dlg.mainFormGroup().columns(1);
}
}
getDialogField() method to bind the report parameters to dialog fields. In this example, parmField1 and parmField2 are the parameters being used.Mandatory Field: The
mandatory(true) method is used to set parmField1 as a mandatory field for the report.SysOperationDialog and used the mainFormGroup().columns(1) method to set the layout to one column.If you want to display the parameters in multiple columns, you can modify the columns() value accordingly.
No comments:
Post a Comment