web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to remove remove scrollbar from parameter window.

(0) ShareShare
ReportReport
Posted on by 40

How to remove Scrollbars from parameter window in AX2012?

ParameterWindow.JPG

Cleared caches and usage data lot of time, even I have redeploy report after deleting it from Reporting Server but in vain. How can I fix that?

Thanks,

Majid 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hello,

    are you using a contract class?

  • Majid Hafeez Profile Picture
    40 on at

    Yes I am using contract, Builder and RDP classes for the report.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
  • Majid Hafeez Profile Picture
    40 on at

    Facing this error at run time :

    error executing code: FormBuildGroupControl object does not have method 'scrollbars'.

  • Vilmos Kintera Profile Picture
    46,149 on at

    It is because you most likely have not followed the post correctly.

    You need to iterate the form controls and find the correct one for which you can disable the scrollbar, which is either the FormBuildTabControl or FormBuildTabPageControl, and not the FormBuildGroupControl. Maybe you need to get 1 level less or more on the controls? You could always check the type of the object with the "is" keyword and compare it against the form control type I mentioned, and if it is the right one, you have found it.

  • Shoaib Ashraf Profile Picture
    180 on at

    Dear Vilmos Kintera,

    Can you explain more, I am getting this error "error executing code: FormBuildGroupControl object does not have method 'scrollbars'."

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    ControlNum refers to specific control within another container control (such as tab, formgroup, etc.) and if you just copy-paste the code, it might point to the wrong control. Thus it is better to iterate through all form controls, and check what are they, since only specific form control types have the scrollbars method available on them.

    So you need to find the correct one.

  • lennynyk Profile Picture
    55 on at

    This worked for me. Thank you.

  • Suggested answer
    lennynyk Profile Picture
    55 on at

    Piggybacking off of Vilmos' solution, I put together this method and called it from the UIBuilder class' build method:

    // Remove the scroll bars from the parameters dialog window, by iterating through the from build design controls hierarchy
    private void removeScrollBars(str ctrlName = "", FormBuildControl _ctrl = null)
    {
        FormBuildDesign frmDesign;
        FormBuildControl ctrl;
        FormBuildGroupControl grpCtrl;
        FormBuildTabControl tbCtrl;
        FormBuildTabPageControl tbpCtrl;
    
        int i, ctrlLength;
    
        if(!_ctrl && !ctrlName)
        {
            frmDesign = this.dialog().formBuildDesign();
            ctrlLength = frmDesign.controlCount();
    
            // Iterate through the top level of the controls hierarchy
            for(i = 1; i <= ctrlLength; i++)
            {
                ctrl = frmDesign.controlNum(i);
    
                if(ctrl is FormBuildGroupControl)
                {
                    grpCtrl = frmDesign.controlNum(i);
                    ctrlName = grpCtrl.name();
    
                    if(ctrlName == "DialogContent")
                    {
                        this.removeScrollBars(ctrlName, ctrl);
                        break;
                    }
                }
            }
        }
        else if (_ctrl)
        {
            ctrlLength = _ctrl.controlCount();
    
            // Iterate through the child controls until the General Tab is found
            for(i = 1; i <= ctrlLength; i++)
            {
                ctrl = _ctrl.controlNum(i);
    
                if(ctrl is FormBuildTabControl)
                {
                    tbCtrl = ctrl;
                    ctrlName = tbCtrl.name();
    
                    if(ctrlName == "Tab")
                    {
                        // Once the Tab control is found, locate the general tab
                        this.removeScrollBars(ctrlName, ctrl);
                        break;
                    }
                }
                else if(ctrl is FormBuildTabPageControl)
                {
                    tbpCtrl = ctrl;
                    ctrlName = tbpCtrl.name();
    
                    if(ctrlName == "General")
                    {
                        // Disable the scroll bars on the general tab. This appropriately resizes the form.
                        tbpCtrl.scrollbars(false);
                        break;
                    }
                }
                else
                {
                    // Keep looking if the desired control isn't found
                    this.removeScrollBars("",ctrl);
                }
            }
        }
    }


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans