Page 1 of 2

Problem disabling menu and toolbar items

Posted: Wed Oct 08, 2008 8:17 am
by Neo77
Hi,

Just installed the newest version (2008.2.300 from 5 October) and it looks amazing!
I got just a little problem disabling menu and toolbar items (with the StiDesignerControl)...I'm using this code:

Code: Select all

// Disable toolbaritems
StiStandardToolbarService toolbarService = StiStandardToolbarService.GetService(stiDesigner);
toolbarService.ShowReportNew = false;
toolbarService.ShowFormNew = false;
toolbarService.ShowReportOpen = false;
toolbarService.ShowClose = false;
toolbarService.ToolBar.Visible = true;

// Disable menuitems
StiMainMenuService mainMenuService = StiMainMenuService.GetService(stiDesigner);
mainMenuService.ShowFileReportNew = false;
mainMenuService.ShowFileFormNew = false;
mainMenuService.ShowFileRecentFiles = false;
mainMenuService.ShowFileExit = false;

// Design report
stiDesigner.Report = stiReport;
All the Items I want to disable are still there....

If I call

Code: Select all

stiDesigner.RefreshToolbars();
before or after designin the report, the Items are disablet but I can't interact with the toolbar (is like freezed...).

Regards,
Chris

Problem disabling menu and toolbar items

Posted: Wed Oct 08, 2008 12:00 pm
by Vital
Hello,

Can you say which type of Gui you are use: standard or ribbon?

Thank you.

Problem disabling menu and toolbar items

Posted: Thu Oct 09, 2008 1:09 am
by Neo77
Hi,

Since we can't change the (blue) color of the new ribbons (or is there an option?) we are using the standard Gui.

Regards,
Chris

Problem disabling menu and toolbar items

Posted: Thu Oct 09, 2008 5:26 pm
by Vital
Hello Chris,

You need your code before report designer creation.
Neo77 wrote: Since we can't change the (blue) color of the new ribbons (or is there an option?)
Other colors will be available soon.

Thank you.

Problem disabling menu and toolbar items

Posted: Fri Oct 10, 2008 1:31 am
by Neo77
Hi,

Thanks for your reply. I create the control now on the fly and add it to the controls collection of my usercontrol; but unfortunately this changes nothing.
I got the same problems as before (icons not disabled or toolbars freezing).

Regards,
Chris

Problem disabling menu and toolbar items

Posted: Mon Oct 13, 2008 9:18 am
by Vital
Hello,

Can you provide sample project?

Thank you.

Problem disabling menu and toolbar items

Posted: Tue Oct 14, 2008 4:04 am
by Vital
Hello,

Please use following code:

Code: Select all

private void InitDesigner()
		{
			StiReport.ClearImageCache();
			StiReport.ClearReportCache();

			StiStandardToolbarService toolbarService = StiStandardToolbarService.GetService(stiDesigner);
			toolbarService.ShowReportNew = false;
			toolbarService.ShowFormNew = false;
			toolbarService.ShowReportOpen = false;
			toolbarService.ShowClose = false;

			StiMainMenuService mainMenuService = StiMainMenuService.GetService(stiDesigner);
			mainMenuService.ShowFileReportNew = false;
			mainMenuService.ShowFileFormNew = false;
			mainMenuService.ShowFileRecentFiles = false;
			mainMenuService.ShowFileExit = false;

			stiDesigner = new StiDesignerControl();
			stiDesigner.Dock = DockStyle.Fill;
			this.Controls.Add(stiDesigner);			

			StiDesigner.SavingReport += new StiSavingObjectEventHandler(StiDesigner_SavingReport);
			StiDesigner.CreatingReport += new StiCreatingObjectEventHandler(StiDesignerControl_CreatingReport);
		}
Thank you.

Problem disabling menu and toolbar items

Posted: Tue Oct 14, 2008 5:57 am
by Neo77
Hi,

Cool - this works! Many thanks!

Best wishes from Switzerland
Chris

Problem disabling menu and toolbar items

Posted: Thu Nov 13, 2008 10:33 am
by stefan_l
hello

i'm having problems with the StiDesignerControl concerning disabling save-buttons.

all was working fine with this code in "form1.initialize":

StiReport.ClearImageCache();
StiReport.ClearReportCache();

Stimulsoft.Report.Design.Toolbars.StiStandardToolbarService.GetService().ShowReportSave = false;

StiMainMenuService mainMenuService = StiMainMenuService.GetService();
mainMenuService.ShowFileReportSave = false;
mainMenuService.ShowFilePageSaveAs = false; // doesn't work in ribbon style anyway

StiDesigner.DontAskSaveReport = true;
StiDesigner.SavingReport += new StiSavingObjectEventHandler(StiSavingDocument);

report = new StiReport();
report.Designer = new StiDesigner();
report.Designer.UseAliases = false;

which (don't ask me why exactly the last two lines were necessary) disabled the save-buttons of my form2.stidesignercontrol1 when i assigned report to form2.stidesignercontrol1.Report over a setter and form2.showed it. in standalone-designer i was not able to get this running (disabling buttons).

but now i'm trying to enable the save-buttons fromout form2 again in certain circumstances (e.g. after a save-as processed). unfortunately i don't have much experience with services and am wondering when/how to do this.

ps: reading all these comments that all didn't work when i tried it out tell me that it might not be very easy to disable/enable the save buttons as one wants at runtime. also a comment whether this is supported or not would be helpful.

pps: the main problem is: each time this code in the constructor is processed
public DesignerForm()
{
InitializeComponent();
StiStandardToolbarService.GetService().ServiceEnabled = false;
StiMainMenuService.GetService().ServiceEnabled = false;

StiConfig.Services.Add(toolbarService);
StiConfig.Services.Add(mainMenuService); StiConfig.Save();
}
StiStandardToolbarService toolbarService = StiStandardToolbarService.GetService();
StiMainMenuService mainMenuService = StiMainMenuService.GetService();
the designerform will jump to the dispose method after assigning a report to it
public void assignreport(StiReport r)
{
this.stiDesignerControl1.Report = r;
this.stiDesignerControl1.ReportFileName = r.ReportName;
}
even if you take the code out again, the services block up something... that means on vista i'm dependant on system restore now to continue developing and would like to know the exact solution or "not possible to disable save-button while designerform is shown" by you.

Problem disabling menu and toolbar items

Posted: Mon Nov 17, 2008 3:12 am
by stefan_l
as i wanted to ask a while ago:

why can't i uninstall stimulsoft on vista? i have the demo and the licenced version installed.

cause on another pc my code works, can you give me instructions how to remove (both) and reinstall the (licenced) package?