Rewrite SaveButton function

Stimulsoft Reports.WPF discussion
Post Reply
Alex124
Posts: 4
Joined: Wed Apr 26, 2017 1:32 pm

Rewrite SaveButton function

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Rewrite SaveButton function

Post 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.
Alex124
Posts: 4
Joined: Wed Apr 26, 2017 1:32 pm

Re: Rewrite SaveButton function

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Rewrite SaveButton function

Post 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.
Alex124
Posts: 4
Joined: Wed Apr 26, 2017 1:32 pm

Re: Rewrite SaveButton function

Post by Alex124 »

Hello,
it's just the reference, so the result is the same, the save button is stil showing. :(
Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Rewrite SaveButton function

Post by Alex K. »

Hello,

Please clarify which version are you use?
Also, please check that you use this code before designer initialization.

Thank you.
Alex124
Posts: 4
Joined: Wed Apr 26, 2017 1:32 pm

Re: Rewrite SaveButton function

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Rewrite SaveButton function

Post by Alex K. »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply