Hi there,
We have a scenario where even if the report has got editable components, we don't want user to edit the report. But currently report viewer will display editor button when the report user is opening has got editable components. I'm using Reports.Web v2018.1.5.
Is there any way I can control displaying editable button? I noticed that report parameters has got isEditableReport variable which decide whether to show the button or not. Can I able to set this variable from my controller action?
Appreciate your help.
Thanks,
Sree
Control editor button in report viewer
Re: Control editor button in report viewer
Hello,
You can use the following option:
Thank you.
You can use the following option:
Code: Select all
@Html.Stimulsoft().StiMvcViewer("MvcViewer1", new StiMvcViewerOptions()
{
Toolbar =
{
ShowEditorButton = false
},
Re: Control editor button in report viewer
Hi Alex,
Thanks for your reply. In my case, I want editor button to be displayed for certain reports and not for others. So I can't use the above option as it will disable the editor button on all reports.
Is there any way I can do it using code. Something inside "GetReport" action method? I noticed an override option for StiMvcViewer.GetReportResult function to accept StiRequestParams as argument. I was looking for some way to switch on and off editor button as a parameter under StiViewerParams.
Looking forward for your response to get a way to get this working.
Thanks,
Sree
Thanks for your reply. In my case, I want editor button to be displayed for certain reports and not for others. So I can't use the above option as it will disable the editor button on all reports.
Is there any way I can do it using code. Something inside "GetReport" action method? I noticed an override option for StiMvcViewer.GetReportResult function to accept StiRequestParams as argument. I was looking for some way to switch on and off editor button as a parameter under StiViewerParams.
Looking forward for your response to get a way to get this working.
Thanks,
Sree
Re: Control editor button in report viewer
Hello, Sree.
There is a PreviewSettings property of the report.
You could change it and the Editor button could be disabled this way.
This property will work in StiMvcViewer from our next build.
You could change the property in the GetReport action using next code:
Thank you.
There is a PreviewSettings property of the report.
You could change it and the Editor button could be disabled this way.
This property will work in StiMvcViewer from our next build.
You could change the property in the GetReport action using next code:
Code: Select all
report.PreviewSettings = report.PreviewSettings ^ (int)Stimulsoft.Report.Viewer.StiPreviewSettings.Editor;
Re: Control editor button in report viewer
Hi HighAley,
Glad to know that there is an option to do this. We are using Reports.Web v2018.1.5. Is this option not available yet?
Just to confirm the usage, can I use the below code to remove the editor option from the viewer? Could you please explain the usage a bit more
Thanks,
Sree
Glad to know that there is an option to do this. We are using Reports.Web v2018.1.5. Is this option not available yet?
Just to confirm the usage, can I use the below code to remove the editor option from the viewer? Could you please explain the usage a bit more
Code: Select all
report.PreviewSettings = report.PreviewSettings & ~(int)Stimulsoft.Report.Viewer.StiPreviewSettings.Editor;
Sree
Re: Control editor button in report viewer
Hello, Sree.
This feature will be available in our next build (2018.1.7).
Yes, your expression should work the same way.
Thank you.
This feature will be available in our next build (2018.1.7).
Yes, your expression should work the same way.
Thank you.