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.