Skip to main content
All docs
V26.1
  • Use DevExpress Templates to Create a Document Viewer Application

    • 3 minutes to read

    You can use DevExpress templates to create an application with the WinForms Document Viewer 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 WinForms Document Viewer 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 WinForms or Reporting in the Platforms list. Then select the project language (C# or VB).

      Select the Report Viewer Application template:

      Project Template Kit - WinForms Report Viewer Application

      Specify additional options.

    CLI Templates

    Install DevExpress CLI Templates

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

    You can also install the templates from nuget.org.

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

    dotnet new install DevExpress.Win.ProjectTemplates
    

    Ensure that the nuget.org source is enabled. If it is disabled, you may encounter error NU1101: Unable to find package DevExpress.Win.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 WinForms Report Viewer application, execute the following command:

    dotnet new dx.win.reporting -n WinReportViewer
    

    The command creates a WinForms application with Report Viewer called WinReportViewer 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.win.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 WinForms templates.

    Template Options

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

    CLI Option Template Kit Option Option Description
    --framework <TFM> Target 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.
    -lang, --language <C#> Specifies the template language to instantiate.
    -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: 26.1.3, 26.1.*, 26.1.*-*
    See Also