This sample project shows how to change the Report Viewer configuration. You just need to set the desired option of the Viewer to
true
if you want to display a certain control. Set the desired option of the Viewer to
false
if you want to hide a certain control. For example,
PreviewControl.ShowBookmarksPanel = cbBookmarks.Checked
means that the bookmarks will be enabled or disabled depending on the value of the checkbox.
This code shows only some options, all options you can see in the downloaded sample project
...
private void cbBookmarks_CheckedChanged(object sender, System.EventArgs e){
PreviewControl.ShowBookmarksPanel = cbBookmarks.Checked;
}
private void cbThumbs_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowThumbsPanel = cbThumbs.Checked;
}
private void cbToolbar_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowToolbar = cbToolbar.Checked;
}
private void cbVerScrollBar_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowVertScrollBar = cbVerScrollBar.Checked;
}
private void cbHorScrollBar_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowHorScrollBar = cbHorScrollBar.Checked;
}
private void cbStatusBar_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowStatusBar = cbStatusBar.Checked;
}
private void cbContextMenu_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowContextMenu = cbContextMenu.Checked;
}
private void cbPrint_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowPrint = cbPrint.Checked;
}
private void cbOpen_CheckedChanged(object sender, System.EventArgs e)
{
PreviewControl.ShowOpen = cbOpen.Checked;
}
...
Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen: