This is a migrated thread and some comments may be shown as answers.

Disabling ReportViewer Toolbar Buttons

0 Answers 248 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
HAtaman
Top achievements
Rank 1
HAtaman asked on 24 May 2017, 12:33 PM

I would like to disable PrintViewToogleButton once it is clicked for PrintView. I do not want to go back to interactive mode again. The main reason for this is that I generate report with images for over 300 pages and RAM extremely goes up to 2GB while using interactive view mode. But printview mode is OK.

I couldn't handle this. Firstly I really wonder how to disable buttons programmatically.

For this purpose, I came up with another solution. I always set the PrintPreview view mode to the reportviewer as following;

    private void ReportViewer_OnRenderingBegin(object sender, CancelEventArgs e)
   {
      
       if (VehiclePass01ViewModel.pageRenderMode != ViewMode.PrintPreview)
       {
 
           this.reportViewer.ViewMode = ViewMode.PrintPreview;
       }
       
   }

 

But in this case, total page number changes strangely as shown on the attachments. Normally there are 343 pages. When I click on the button again, total page number changes to 685,681,686 or 684. But actually, page number is still 343 on the report. If I try to go to next pages by buttons, it goes until 343 despite the count is 68X which is correct.

 

If disabling button would exist, that could be awesome.

 

Any solution is very welcome.

Thank you.

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
HAtaman
Top achievements
Rank 1
Share this question
or