Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to remove remove scrollbar from parameter window.

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

  • Suggested answer
    lennynyk Profile Picture
    lennynyk 55 on at
    RE: How to remove remove scrollbar from parameter window.

    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);
                }
            }
        }
    }


  • lennynyk Profile Picture
    lennynyk 55 on at
    RE: How to remove remove scrollbar from parameter window.

    This worked for me. Thank you.

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to remove remove scrollbar from parameter window.

    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.

  • Shoaib Ashraf Profile Picture
    Shoaib Ashraf 180 on at
    RE: How to remove remove scrollbar from parameter window.

    Dear Vilmos Kintera,

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

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to remove remove scrollbar from parameter window.

    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.

  • Majid Hafeez Profile Picture
    Majid Hafeez 40 on at
    RE: How to remove remove scrollbar from parameter window.

    Facing this error at run time :

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

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to remove remove scrollbar from parameter window.

    Check this:

    dynamicsaxdeveloperz.blogspot.hu/.../scrollbars-appearing-on-dynamically.html

  • Majid Hafeez Profile Picture
    Majid Hafeez 40 on at
    RE: How to remove remove scrollbar from parameter window.

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to remove remove scrollbar from parameter window.

    Hello,

    are you using a contract class?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans