Page 1 of 2

Hide Tools etc

Posted: Thu May 02, 2013 2:57 pm
by DHarvey
Hi guys,

Two Questions:

1/
I was curious to know if anyone has managed to be able to hide the Toolbox in the StiReportDesigner.
I know most of these settings sit withing the services, I just cannot find the right one.

2/
I was also wanting to know if anyone knew how to hide particular tabs in the report designer such as a StiPage.
I imagine it is just setting the tab to be not visible under the control.

Let me know if you need more information, thanks in advance.

Note this should be by code not by user interaction. It should be possible to do these if a user can switch them off.

Kind Regards
David

Re: Hide Tools etc

Posted: Fri May 03, 2013 10:16 am
by DHarvey
For Question 1:

Code: Select all

 StiService[] services = StiToolbarService.GetToolbarServices(_ReportDesigner);

                foreach (StiToolbarService service in services)
                {
                    if (service is StiToolboxToolbarService)
                    {
                        if (service.ToolBar != null)
                        {
                            service.ToolBar.Visible = false;
                            service.ToolBar.Enabled = false;
                        }
                    }
                }

Re: Hide Tools etc

Posted: Fri May 03, 2013 12:08 pm
by HighAley
Hello, David.
DHarvey wrote:1/
I was curious to know if anyone has managed to be able to hide the Toolbox in the StiReportDesigner.
I know most of these settings sit withing the services, I just cannot find the right one.
Do you want to completely remove toolbox? Then if will be impossible to add any component on the page.
DHarvey wrote:2/
I was also wanting to know if anyone knew how to hide particular tabs in the report designer such as a StiPage.
I imagine it is just setting the tab to be not visible under the control.
What tab do you want to hide? Could you describe your issue more detailed.

Thank you.

Re: Hide Tools etc

Posted: Fri May 03, 2013 12:21 pm
by DHarvey
Hi Aleksey,

1/

I managed to hide the toolbox by using the code above. I wanted to do it via code as I am taking advantage of some of the features that the viewer does not have (to my knowledge); that the designer has.

The feature that I needed to use in the report viewer is the preview tab. When you launch the report in the report viewer it does not display the same dash board for variables that you get in the preview mode of the report designer to change the variables. Maybe my implementation is missing something that allows variables to be set in the report viewer - I have not been able to do this yet.

2/

Despite it being a report designer, I want to hide the StiPages and only display the preview mode of the report so that a user can use and execute the report. I have managed to hide the StiPages tab by filtering through the controls of the ReportDesigner and finding the TabControl.

Code: Select all


if (ReportDesigner != null)
            {
                foreach (Control control in ReportDesigner.Controls)
                {
                    Stimulsoft.Controls.Win.DotNetBar.TabControl myControl = control as Stimulsoft.Controls.Win.DotNetBar.TabControl;

                    if (myControl != null)
                    {
                        TabsCollection myTabs = myControl.Tabs;

                        foreach (TabItem myTab in myTabs)
                        {
                            if (myTab.Text.Contains("Page"))
                            {
                                myTab.Visible = false;
                            }
                        }
                    }
                }
            }


Note the code I have just posted is just a knock up of how to set the tabs to visible and could be re-factored and surely improved!

So really my question is does the StiReportViewer allow the user to update the variables like the StiReportDesigner does with the same provided controls?

Re: Hide Tools etc

Posted: Mon May 06, 2013 7:40 am
by HighAley
DHarvey wrote:1/

I managed to hide the toolbox by using the code above. I wanted to do it via code as I am taking advantage of some of the features that the viewer does not have (to my knowledge); that the designer has.

The feature that I needed to use in the report viewer is the preview tab. When you launch the report in the report viewer it does not display the same dash board for variables that you get in the preview mode of the report designer to change the variables. Maybe my implementation is missing something that allows variables to be set in the report viewer - I have not been able to do this yet.

2/

Despite it being a report designer, I want to hide the StiPages and only display the preview mode of the report so that a user can use and execute the report. I have managed to hide the StiPages tab by filtering through the controls of the ReportDesigner and finding the TabControl.

Code: Select all


if (ReportDesigner != null)
            {
                foreach (Control control in ReportDesigner.Controls)
                {
                    Stimulsoft.Controls.Win.DotNetBar.TabControl myControl = control as Stimulsoft.Controls.Win.DotNetBar.TabControl;

                    if (myControl != null)
                    {
                        TabsCollection myTabs = myControl.Tabs;

                        foreach (TabItem myTab in myTabs)
                        {
                            if (myTab.Text.Contains("Page"))
                            {
                                myTab.Visible = false;
                            }
                        }
                    }
                }
            }


Note the code I have just posted is just a knock up of how to set the tabs to visible and could be re-factored and surely improved!

So really my question is does the StiReportViewer allow the user to update the variables like the StiReportDesigner does with the same provided controls?
It's impossible to change Designer to became the Viewer.
There should be the same parameters panel in the Viewer as in the Designer. Could you describe your issue more detailed? Do you use the Variables with Request From User parameter?
Please, look at the Parameters section in our Demo.

Thank you.

Re: Hide Tools etc

Posted: Tue May 07, 2013 12:18 pm
by DHarvey
Hi Aleksey,

Firstly, thank you for your reply.

I concur that it is not the best option to override the StiDesigner to turn it into a viewer but the only choice we have at the moment is to do this as I cannot for the life of me get the ParameterPanel which displays the variables to display in the StiViewerControl.

I cannot send a sample project of our work as it one to big and sensitive.

What I can do is try and highlight some of the ways I am trying to display the parameter panel.

Code: Select all

            ReportViewer.SetParametersButtonChecked(!ReportViewer.GetParametersButtonChecked);
I have to use the above as it does not have an invoke method like "InvokeToolFind()".

Code: Select all

        void IReportViewer.InvokeToolFind()
        {
            ReportViewer.InvokeToolFind();
        }
I can confirm that I have variables which do have the prompt option set "Request from user", please see the attached document for some images.

Re: Hide Tools etc

Posted: Tue May 07, 2013 12:29 pm
by DHarvey
Oh and to top it off, the preview control of the StiDesignerControl displays the parameter menu.

Let me know if you have any suggestions.

Kind Regards,
David

Re: Hide Tools etc

Posted: Wed May 08, 2013 6:39 am
by HighAley
Hello, David.

Let's focus on your main problem with showing parameters panel in the StiViewerControl.
At first we should know which version do you use.
Please, try to remove the %LOCALAPPDATA%\Stimulsoft folder and try to use the StiViewerControl again.
Also it will be good to see your report template.

Thank you.

Re: Hide Tools etc

Posted: Wed May 08, 2013 9:08 am
by DHarvey
Hi Aleksey,

Thanks for that, I believe the problem is going to be a layout issue so I have attached an example of one of our mrt's. You may need to update the script to remove the reference to our dll's to get it to load at your end.

I also removed the folder you said and it has had no effect, I strongly believe it has something to do with the mrt I have given you. Let me know if you spot anything!

If you need any more information let me know, the version of the software is 2012.2.1400.0 - according to the referenced dll's.

Thanks for your help.

Kind Regards,
David

Re: Hide Tools etc

Posted: Wed May 08, 2013 9:18 am
by DHarvey
It is something to do with the script ... I can use one of the demo projects to load our layout when I modify the script to the exampled script.

Now to figure out which piece