ActiveReports 14 .NET Edition
ActiveReports 14 User Guide / Preview Reports / WPF Viewer
In This Topic
    WPF Viewer
    In This Topic

    ActiveReports provides the WPF Viewer that you can use to load and view your reports. This viewer contains a toolbar and a sidebar with Thumbnails, Search results, Document map and Parameters panes.

    The WPF Viewer has a limitation in the continuous mode. In this mode, a report is always rendered on top of the WPF Viewer because the WinForms content always appears on top of the WPF content.

    Warning: The TargetInvocationException occurs on running a WPF browser application in Partial Trust. Refer to Running WPF Viewer in Partial Trust section given below to run your WPF Browser Application in Partial Trust. To ensure that you are using Full Trust:

    1. From the Visual Studio Project menu, select YourProject Properties.
    2. On the Security tab, under Enable ClickOnce security settings, select the This is a full trust application option.

    WPF Viewer Toolbar

    The following table lists the actions you can perform through the WPF Viewer toolbar.

    Toolbar Element Name Description
    Toolbar Element button Toggle Sidebar Displays the sidebar that includes the Thumbnails, Parameters, Document map and Search results panes.
    Print button Print Displays the Print dialog where you can specify the printing options.
    Galley mode button Galley mode Provides a viewer mode which removes automatic page breaks from an RDL report and displays the data in a single scrollable page. This mode maintains page breaks you create in the report.1
    Find button Find Displays the Find dialog to find any text in the report.
    Zoom out button Zoom out Decreases the magnification of your report.
    Zoom in button Zoom in Increases the magnification of your report.
    Current zoom button Current zoom Displays the current zoom percentage which can also be edited.
    Fit page width button Fit page width Fits the width of the page according to viewer dimensions.
    Fit whole page button Fit whole page Fits the whole page within the current viewer dimensions.
    First page button First page Takes you to the first page of the report. This button is enabled when a page other than the first page is open.
    Previous page button Previous page Takes you to the page prior to the current page. This button is enabled when a page other than the first page is open.
    Current page button Current page Opens a specific page in the report. To view a specific page, type the page number and press the Enter key.
    Next page button Next page Takes you to the page following the current page. This button is disabled on reaching the last page of the report.
    Last page button Last page Takes you to the last page of the report. This button is disabled on reaching the last page of the report.
    Backward button Backward Takes you to the last viewed page. This button is enabled when you move to any page from the initial report page. Clicking this button for the first time also enables the Forward button.
    Forward button Forward Takes you to last viewed page before you clicked the Backward button. This button is enabled once you click the Backward button.
    Back to parent report button Back to parent report Returns you to the parent report in a drillthrough report.
    Refresh button Refresh Refreshes the report.
    Cancel button Cancel Cancels rendering of the report.

    1To view drillthrough reports in WPF Viewer, you need to turn off the Galley mode.

    WPF Viewer Sidebar

    The WPF Viewer sidebar appears on the left of the Viewer control when you click the Toggle sidebar button in the toolbar. By default, this sidebar shows the Thumbnails and Search Results panes. The additional Document map and Parameters also appear in this sidebar. You can toggle between any of the viewer panes by clicking the buttons for each pane at the bottom of the sidebar.

    Thumbnails pane

    The Thumbnails pane appears by default in the sidebar when you click the Toggle sidebar button in the toolbar.

    This pane is composed of a thumbnail view of all the pages in a report. Click any thumbnail to navigate directly to the selected report page. You can also modify the size of the thumbnail when you click (+) or (-) button to zoom in and zoom out.

    Thumbnails pane

    Thumbnails pane

    Search results pane

    The Search pane is the other default pane besides Thumbnails that appears in the sidebar when you click the Toggle sidebar button. This pane lets you enter a word or phrase from which to search within the report.

    Search results pane

    Search results pane

    To search in a report:

    • Enter the word or phrase in the search field.
    • Under Use these additional criteria, you may optionally choose to search for the whole word or match the case of the search string while searching in the report.
    • Click the Search button to see the results appear in the Find results list.
    • Click an item in the list to jump to that item in the report and highlight it.

    To start a new search or clear the current search results, click the Clear button under the Find results list.

    Document map pane

    The Documents map pane sis enabled for reports where the Label property or the Document map label is set. This pane displays each value for the text box, group, or sub report that you label, and you can click them to navigate to the corresponding area of the report in the Viewer.

    Document map pane

    Document map pane

    If a report does not have the Label property or Document map label set, the Documents map panes does not appear in the sidebar.

    Parameters pane

    The WPF Viewer allows you to view reports with parameters. In the toolbar, click the Toggle sidebar button to open the WPF Viewer sidebar and if your report contains parameters, the Parameters pane shows up automatically.

    Parameters pane

    Parameters pane

    1. In the Parameters pane, you are prompted to enter a value by which to filter the data to display.
    2. Enter a value or set of values and click View report, to filter the report data and display the report.

    If a report does not have parameters, the Parameters pane does not appear in the sidebar.

    Additional Features

    Following is an introduction to the additional capabilities of the Viewer to guide you on using it effectively.

    Keyboard Shortcuts

    The following shortcuts are available on the WPF Viewer.

    Keyboard Shortcut Action
    Ctrl + F Shows the search pane.
    Ctrl + P Shows the print dialog.
    Esc Closes the print dialog.
    Page Down Moves to the next page.
    Page Up Moves to the previous page.
    Ctrl + T Shows or hides the table of contents.
    Ctrl + Home Moves to the first page.
    Ctrl + End Moves to the last page.
    Ctrl + Right Navigates forward.
    Ctrl + Left Navigates backward.
    Ctrl + - Zooms out.
    Ctrl + + Zooms in.
    Left, Right, Up, Down Moves the visible area of the page in the corresponding direction.
    Ctrl + 0 (zero) Sets the zoom level to 100%.
    Ctrl + rotate mouse wheel Changes the zoom level up or down.
    Ctrl + G Moves the focus to current page toolbar option.
    F5 Refreshes the report.

    Advance Printing Options

    You can set the PrintingSettings property of the Viewer to directly print without displaying a dialog or to switch from a ActiveReports print dialog to a .NET Framework standard print dialog (System.Windows.Forms.PrintDialog) on clicking the Print button on the Viewer toolbar. You can set the PrintingSettings property of the Viewer control from the Properties window.


    PrintingSettings property provides the following options:

    PrintingSettings Options Description
    ShowPrintDialog

    Displays a dialog in which the user can set the printer options before printing.

    ShowPrintProgressDialog Displays a print progress dialog, in which the user can cancel the printing job.
    UsePrintingThread Specifies whether printing should be performed for individual threads or not.
    UseStandardDialog Specifies whether to use the .NET Framework standard print dialog (System.Windows.Forms.PrintDialog) while printing the document (section or page).

    Running WPF Viewer in Partial Trust

    You can run a WPF Viewer Browser Application in Partial Trust by customizing the permission set in the app.mainfest file. While customizing the permission set, some of the permissions are to be set explicitly like MediaPermission, UIPermission, etc. Follow these steps to learn how to run a WPF Viewer application in partial trust.

    Note: These steps assume that you have already created a WPF Browser Application that contains the WPF Viewer control.
    1. In the Solution Explorer, right-click your WPF Browser Application and select Properties.
    2. On the properties page that opens, go to the Security tab.
    3. On the Security tab, set Zone your application will be installed from to Custom and click the Edit Permissions XML button. This opens the app.mainfest file.
    4. In the app.manifest file, replace the existing xml code inside the <applicationRequestMinimum> </applicationRequestMinimum> tags with the following code.

      Code

      XML
      Copy Code
      <defaultAssemblyRequest permissionSetReference="Custom" />
      <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site">
        <IPermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Security.Permissions.MediaPermission, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" version="1" Audio="SafeAudio" Video="SafeVideo" Image="SafeImage" />
        <IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
        <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />>
        <IPermission class="System.Security.Permissions.StrongNameIdentityPermission, , mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
      </PermissionSet>
      
    5. Press F5 to run your WPF Browser Application.
    Note: The Partial Trust Limitations are applicable to the WPF viewer running in Partial Trust. For more information, see Medium Trust Support.

     

    See Also