xtrareports-405601-desktop-reporting-winforms-reporting-winforms-reporting-print-preview-quick-start-create-a-print-preview-app-with-cli.md
You can use the .NET command-line interface (CLI) 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.
Execute the following command to install DevExpress WinForms project templates from nuget.org:
dotnet new install DevExpress.Win.ProjectTemplates
If the NuGet.org package source is disabled, you will get the following error: NU1101: Unable to find package DevExpress.Win.ProjectTemplates. To see the list of sources and their status information, run the command dotnet nuget list source. To enable a source, run the command 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.
Note
DevExpress CLI project templates are also available in the DevExpress NuGet Gallery (nuget.devexpress.com).
To create a WinForms Document Viewer application, execute the following command:
dotnet new dx.win.reporting -n WinDocumentViewer
The command creates a WinForms application with Document Viewer called WinDocumentViewer 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 - OptionsStandard options for .NET CLI templates.Template OptionsOptions specific to the DevExpress WinForms templates.
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:
The following list contains options you can specify when creating DevExpress WinForms Reporting project templates:
-prerelease, --use-prerelease-dx-versionA flag that indicates whether to use a pre-release DevExpress package version in the project.--framework <TFM>Specifies the target framework. It expects a target framework moniker (TFM). Example: net8.0.--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).