While developing an SSRS report in AX 2012 I was facing an issue. I have dynamically created SSRS report contract using a contract class. On my dialog there was a field parmCompanyAddress to store the address of currently logged in company.
public LogisticsAddressing parmCompanyAddress(LogisticsAddressing _address = companyAddress)
{
companyAddress = _address;
return companyAddress;
}
I marked this field as hidden because I don't want my user to view the company address on the contract and binded the value of this field on the report design. But this field created scrollbars on my dynamically created contract form.
To resolve this issue I developed a "UI Builder" class and extend the "Build" method of my "UI Builder" class.
Here is the code that I wrote to overcome this issue,
public void build()
{
FormBuildTabPageControl tabGeneral;
super();
dialogLocal = this.dialog();
tabGeneral =
dialog.dialogForm().buildDesign() .controlNum(1).controlNum(1).controlNum(1);
tabGeneral.scrollbars(0);
}
This code fix the issue of scrollbars.
What this code does is,
public LogisticsAddressing parmCompanyAddress(LogisticsAddressing _address = companyAddress)
{
companyAddress = _address;
return companyAddress;
}
I marked this field as hidden because I don't want my user to view the company address on the contract and binded the value of this field on the report design. But this field created scrollbars on my dynamically created contract form.
To resolve this issue I developed a "UI Builder" class and extend the "Build" method of my "UI Builder" class.
Here is the code that I wrote to overcome this issue,
public void build()
{
FormBuildTabPageControl tabGeneral;
super();
dialogLocal = this.dialog();
tabGeneral =
dialog.dialogForm().buildDesign() .controlNum(1).controlNum(1).controlNum(1);
tabGeneral.scrollbars(0);
}
This code fix the issue of scrollbars.
What this code does is,
- First I called the super method to run the code of base class.
- Then in the object "dialogLocal" I store the reference of my dynamically created dialog.
- Object "tabGeneral" is the control which is displaying the scrollbars so I traverse the complete hierarchy to obtain my desired control.
- When I got my control which is showing the scrollbars, I called its method "scrollbars" and set "0" in it to remove the scrollbars.
Hope the information is useful for you.
error executing code: FormBuildGroupControl object does not have method 'scrollbars'
ReplyDeleteFacing this error at run time
Thanks a lot!
ReplyDelete