Page 1 of 1
Rewrite SaveButton function
Posted: Wed Apr 26, 2017 1:57 pm
by Alex124
Hi
I'm using Stimulsoft Reports for the first time. I need to rewrite function when save button is clicked or to hide this buton. Can you please help me? I have tried something like <WpfDesign:StiWpfDesignerControl ShowMainMenu="False" /> in xaml, but it doesn't work. Can you help me please?
Thank you.
Re: Rewrite SaveButton function
Posted: Thu Apr 27, 2017 6:54 am
by Alex K.
Hello,
Please try to use the following event
StiOptions.Engine.GlobalEvents.SavingReportInDesigner += ;
if need to hide:
StiOptions.Designer.MainMenu.ShowFileReportSave = false;
Thank you.
Re: Rewrite SaveButton function
Posted: Thu Apr 27, 2017 10:58 am
by Alex124
Hello,
thank you the command " StiOptions.Engine.GlobalEvents.SavingReportInDesigner += " has worked, so thank you very mych. But " StiOptions.Designer.MainMenu.ShowFileReportSave = false; " doesn't work. So can you help me with that please?
I have this in xaml <WpfDesign:StiWpfDesignerControl Name="StiDesigner"/>
after window is loaded i call
private void Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var model = (ReportingViewModel)ViewModel;
StiDesigner.Report = model.StiReport;
}
Where I should write ShowFileReportSave = false ? I have tried in Loaded function and in constructor but the Savebutton is still showing.
Thank you
Re: Rewrite SaveButton function
Posted: Thu Apr 27, 2017 7:45 pm
by Alex K.
Hello,
Sorry for the mistake. For the WPF designer you can use the following option:
Code: Select all
Stimulsoft.Report.StiOptions.Designer.Ribbon.ShowMainMenuReportSave = false;
Thank you.
Re: Rewrite SaveButton function
Posted: Fri Apr 28, 2017 11:50 am
by Alex124
Hello,
it's just the reference, so the result is the same, the save button is stil showing.
Thank you.
Re: Rewrite SaveButton function
Posted: Mon May 01, 2017 9:59 am
by Alex K.
Hello,
Please clarify which version are you use?
Also, please check that you use this code before designer initialization.
Thank you.
Re: Rewrite SaveButton function
Posted: Mon May 01, 2017 10:30 am
by Alex124
Hello,
thank you for your help. If I have used the code before initialization it has worked.
Thank you very much.
Problem solved.
Re: Rewrite SaveButton function
Posted: Mon May 01, 2017 2:42 pm
by Alex K.
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.