Dashboard viewer disable buttons

Stimulsoft Dashboards.WIN discussion
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Dashboard viewer disable buttons

Post by ddsmith99301 »

How do I disable the edit and open buttons on the StiDashboardViewerControl? I don't want users to be able to edit the dashboard from the viewer screen.
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: Dashboard viewer disable buttons

Post by Lech Kulikowski »

Hello,

You can set it in the PreviewSettings for the report.

Thank you.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

I have tried everything with the report.PreviewSettings including setting it to 0 without success. Here is a segment of my code.

Dim report As StiReport = New StiReport()
report.Load(strFileName)
.
.
.
If report.PreviewSettings And CInt(Stimulsoft.Report.Viewer.StiPreviewSettings.Editor) = CInt(Stimulsoft.Report.Viewer.StiPreviewSettings.Editor) Then
report.PreviewSettings = report.PreviewSettings And CInt(Not Stimulsoft.Report.Viewer.StiPreviewSettings.Editor)
End If
.
.
.
ViewerControl = New StiDashboardViewerControl(report)
Attachments
2019-05-22_1317.png
2019-05-22_1317.png (19.4 KiB) Viewed 6375 times
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

Lech Kulikowski wrote: Fri May 03, 2019 5:44 pm Hello,

You can set it in the PreviewSettings for the report.

Thank you.
PLEASE someone answer this. I need help with this.

I have tried everything with the report.PreviewSettings including setting it to 0 without success. Here is a segment of my code.

Dim report As StiReport = New StiReport()
report.Load(strFileName)
.
.
.
If report.PreviewSettings And CInt(Stimulsoft.Report.Viewer.StiPreviewSettings.Editor) = CInt(Stimulsoft.Report.Viewer.StiPreviewSettings.Editor) Then
report.PreviewSettings = report.PreviewSettings And CInt(Not Stimulsoft.Report.Viewer.StiPreviewSettings.Editor)
End If
.
.
.
ViewerControl = New StiDashboardViewerControl(report)
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

I really need documentaion for the StiDashboardViewerControl.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

Lech Kulikowski wrote: Fri May 03, 2019 5:44 pm Hello,

You can set it in the PreviewSettings for the report.

Thank you.

Is it possible that you could expose the properties
StiDashboardViewerControl.buttonEditDashboard
and StiDashboardViewerControl.buttonOpenDashboard?
It appears they are currently 'protected'.

I believe this would give the option to disable the edit and open buttons on the dashboard viewer so the users would not be able to edit or open another dashboard. I need to have control of those with code that restricts the user to only the dashboard they are working on.
.
2019-05-24_1400.png
2019-05-24_1400.png (41.51 KiB) Viewed 6357 times
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: Dashboard viewer disable buttons

Post by Lech Kulikowski »

Hello,

Please check the following code:

Code: Select all

var report = StiReport.CreateNewDashboard();
report.DashboardViewerSettings = StiDashboardViewerSettings.None;
Thank you.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

Thank you! Is there a way to show some of the buttons, but not all?
If I use this code it still shows all of the buttons.

var report = StiReport.CreateNewDashboard();
report.DashboardViewerSettings = StiDashboardViewerSettings.ShowRefreshButton;
Lech Kulikowski
Posts: 6163
Joined: Tue Mar 20, 2018 5:34 am

Re: Dashboard viewer disable buttons

Post by Lech Kulikowski »

Hello,

Please check the following code:
report.DashboardViewerSettings = (StiDashboardViewerSettings.ShowToolBar | StiDashboardViewerSettings.ShowRefreshButton);

Thank you.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: Dashboard viewer disable buttons

Post by ddsmith99301 »

Lech Kulikowski wrote: Tue May 28, 2019 8:14 am Hello,

Please check the following code:
report.DashboardViewerSettings = (StiDashboardViewerSettings.ShowToolBar | StiDashboardViewerSettings.ShowRefreshButton);

Thank you.
Thank you so much. That works well.

In vb.net:

report.DashboardViewerSettings = (StiDashboardViewerSettings.ShowToolBar Or StiDashboardViewerSettings.ShowRefreshButton)
Post Reply