Skip to main content
All docs
V25.2
  • Use DevExpress Template to Create a Document Preview Application

    • 3 minutes to read

    You can use DevExpress templates to create an application with the WPF Document Preview control from the console. Note that the project template targets .NET 8.0+ and supports C# only.

    Project Template Kit (Visual Studio, Visual Studio Code, JetBrains Rider)

    The DevExpress Template Kit offers a unified project creation experience for Microsoft Visual Studio, Visual Studio Code, and JetBrains Rider.

    To create a WPF Document Preview application, follow the steps below:

    1. Install the DevExpress Project Template Kit extension. Refer to the following sections in the Project Template Kit help topic for instructions based on your IDE:

    2. Select WPF or Reporting in the Platforms list. Select the Report Viewer Application template:

      Project Template Kit - WPF Report Viewer Application

      Specify additional options.

    CLI Templates

    Install DevExpress CLI Templates

    DevExpress WPF project templates are included in our Unified Component Installer.

    You can also install the templates from nuget.org or the DevExpress NuGet Gallery (nuget.devexpress.com).

    Execute the following command to install DevExpress WPF project templates from nuget.org:

    dotnet new install DevExpress.Wpf.ProjectTemplates
    

    Ensure that the nuget.org source is enabled. If it is disabled, you may encounter error NU1101: Unable to find package DevExpress.Wpf.ProjectTemplates. To list sources with their status, run dotnet nuget list source. To enable a source, run dotnet nuget enable source <source name>.

    If you are new to NuGet, visit the following page for more information about package management prerequisites: An Introduction to NuGet.

    Create a Project

    To create a WPF Document Viewer application, execute the following command:

    dotnet new dx.wpf.reporting -n WPFDocumentPreview
    

    The command creates a WPF application with Document Preview called WPFDocumentPreview in the current directory.

    You can use the following parameters to see available command options: -? | -h | --help. For example, execute the following command:

    dotnet new dx.wpf.reporting --help
    

    Refer to the following documents for information on template options:

    dotnet new command - Options
    Standard options for .NET CLI templates.
    Template Options
    Options specific to the DevExpress WPF templates.

    Build the Project

    You need to configure your personal DevExpress NuGet Feed to load the required DevExpress component packages and build the resulting project. Follow the instructions below:

    1. Obtain your NuGet feed URL.
    2. Register the source. You can do this in your IDE or from a CLI:

    Template Options

    The following list contains options you can specify when creating DevExpress WPF Reporting project templates:

    CLI Option Template Kit Option Option Description
    --framework <TFM> Framework Specifies the target framework. It expects a target framework moniker (TFM). Example: net8.0.
    -mcp, --use-devexpress-mcp Use DevExpress MCP Installs the DevExpress Documentation MCP Server for the generated solution. GitHub Copilot queries DevExpress documentation through this server to improve response accuracy and reduce model hallucinations. Refer to DevExpress Documentation MCP Server for setup details.
    -preload, --preload-resources Preload DevExpress Resources During Startup Preload theme resources on application launch to speed up the display time for all subsequent windows. For more information, refer to Preload Theme Resources. Default: true
    -lwthemes, --lightweight-themes Use Lightweight Themes Use DevExpress lightweight themes instead of regular themes. For more information, refer to Lightweight Themes. Default: true
    -prerelease, --use-prerelease-dx-version A flag that indicates whether to use a pre-release DevExpress package version in the project.
    --dx-version <version> Specifies DevExpress package version to be used in the project. Examples: 25.2.3, 25.2.*, 25.2.*-*
    --dx-nuget-feed <feed> Specifies the NuGet Feed URL. Refer to nuget.devexpress.com to obtain your personal feed URL (available for registered users).