diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 0490e4ebbfcf8..a0b117e0d9a45 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -2055,10 +2055,41 @@ "source_path": "docs/visual-basic/developing-apps/debugging.md", "redirect_url": "/visualstudio/debugger/debugger-basics" }, + { + "source_path": "docs/visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/ms233804(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb882689(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb629268(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb690944(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb629243(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb629256(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/index.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb882691(v=vs.100)", + }, + { + "source_path": "docs/visual-basic/developing-apps/printing/printform-component.md", + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb690938(v=vs.100)", + }, { "source_path": "docs/visual-basic/developing-apps/printing/printing-and-reporting.md", - "redirect_url": "/dotnet/visual-basic/developing-apps/printing/index", - "redirect_document_id": true + "redirect_url": "https://docs.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb882691(v=vs.100)", }, { "source_path": "docs/visual-basic/developing-apps/programming/app-settings/accessing-application-settings.md", diff --git a/docs/toc.md b/docs/toc.md index 839e04f96aea7..33ab092f23edc 100644 --- a/docs/toc.md +++ b/docs/toc.md @@ -504,15 +504,6 @@ ### [Accessing Data](visual-basic/developing-apps/accessing-data.md) ### [Creating and Using Components](visual-basic/developing-apps/creating-and-using-components.md) -### [Printing and Reporting](visual-basic/developing-apps/printing/index.md) -#### [PrintForm Component](visual-basic/developing-apps/printing/printform-component.md) -#### [How to: Print a Scrollable Form](visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md) -#### [How to: Print Client and Non-Client Areas of a Form](visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) -#### [How to: Print the Client Area of a Form](visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md) -#### [How to: Print a Form by Using the PrintForm Component](visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md) -#### [Deploying Applications That Reference the PrintForm Component](visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md) -#### [Adding Printable Reports to Visual Studio Applications](visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md) - ### [Windows Forms Application Basics](visual-basic/developing-apps/windows-forms/index.md) ### [Customizing Projects and Extending My with Visual Basic](visual-basic/developing-apps/customizing-extending-my/index.md) diff --git a/docs/visual-basic/developing-apps/index.md b/docs/visual-basic/developing-apps/index.md index 1924927e7a94e..4a09e76734bfc 100644 --- a/docs/visual-basic/developing-apps/index.md +++ b/docs/visual-basic/developing-apps/index.md @@ -22,9 +22,6 @@ This section covers conceptual documentation for the Visual Basic language. [Creating and Using Components in Visual Basic](../../visual-basic/developing-apps/creating-and-using-components.md) Defines the term *component* and discusses how and when to create components. - [Printing and Reporting](../../visual-basic/developing-apps/printing/index.md) - Provides overviews and links to the relevant documentation related to printing and reporting. - [Windows Forms Application Basics](../../visual-basic/developing-apps/windows-forms/index.md) Provides information about creating Windows Forms applications by using Visual Studio. diff --git a/docs/visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md b/docs/visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md deleted file mode 100644 index 14ada5b934b09..0000000000000 --- a/docs/visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "Adding Printable Reports to Visual Studio Applications" -ms.date: 07/20/2015 -helpviewer_keywords: - - "printing [Visual Studio], reports" - - "reports [Visual Basic], printing in Visual Studio" -ms.assetid: 93928405-ef41-495e-bce2-9d43d5a7080a ---- -# Adding Printable Reports to Visual Studio Applications -Visual Studio supports a variety of reporting solutions to help you add rich data reporting to your Visual Basic applications. You can create and add reports using ReportViewer controls, Crystal Reports, or SQL Server Reporting Services. - - -## Overview of Microsoft Reporting Technology in Visual Basic Applications - Choose from the following approaches to use a Microsoft reporting technology in your application: - -- Add one or more instances of a ReportViewer control to a Visual Basic Windows application. - -- Integrate SQL Server Reporting Services programmatically by making calls to the Report Server Web service. - -- Use the ReportViewer control and Microsoft SQL Server 2005 Reporting Services together, using the control as a report viewer and a report server as a report processor. (Note that you must use the SQL Server 2005 version of Reporting Services if you want to use a report server and the ReportViewer control together). - -## Using ReportViewer Controls - The easiest way to embed report functionality into a Visual Basic Windows application is to add the ReportViewer control to a form in your application. The control adds report processing capabilities directly to your application and provides an integrated report designer so that you can build reports using data from any ADO.NET data object. A full-featured API provides programmatic access to the control and reports so that you can configure run-time functionality. - - ReportViewer provides built-in report processing and viewing capability in a single, freely distributable data control. Choose ReportViewer controls if you require the following report functionality: - -- Report processing in the client application. A processed report appears in a view area provided by the control. - -- Data binding to ADO.NET data tables. You can create reports that consume instances supplied to the control. You can also bind directly to business objects. - -- Redistributable controls that you can include in your application. - -- Runtime functionality such as page navigation, printing, searching, and export formats. A ReportViewer toolbar provides support for these operations. - - To use the ReportViewer control, you can drag it from the **Data** section of the Visual Studio Toolbox onto a form in your Visual Basic Windows application. - -### Creating Reports in Visual Studio for ReportViewer Controls - To build a report that runs in ReportViewer, add a **Report** template to your project. Visual Studio creates a client report definition file (.rdlc), adds the file to your project, and opens an integrated report designer in the Visual Studio workspace. - - The Visual Studio Report Designer integrates with the **Data Sources** window. When you drag a field from the **Data Sources** window to the report, the Report Designer copies metadata about the data source into the report definition file. This metadata is used by the ReportViewer control to automatically generate data-binding code. - - The Visual Studio Report Designer does not include report preview functionality. To preview your report, run the application and preview the report embedded in it. - -|To add basic report functionality to your application| -|---| -|1. Drag a ReportViewer control from the **Data** tab of the **Toolbox** onto your form.
2. On the **Project** menu, choose **Add New Item**. In the **Add New Item** dialog box, select the **Report** icon and click **Add**.
The Report Designer opens in the development environment, and a report (.rdlc) file is added to the project.
3. Drag report items from the **Toolbox** on the report layout and arrange them as you want.
4. Drag fields from the **Data Sources** window to the report items in the report layout.| - -## Using Reporting Services in Visual Basic Applications - Reporting Services is a server-based reporting technology that is included with SQL Server. Reporting Services includes additional features that are not found in the ReportViewer controls. Choose Reporting Services if you require any of the following features: - -- Scale-out deployment and server-side report processing that provides improved performance for complex or long-running reports and for high-volume report activity. - -- Integrated data and report processing, with support for custom report controls and rich rendering output formats. - -- Scheduled report processing so that you can specify exactly when reports are run. - -- Subscriber-based report distribution through email or to file share locations. - -- Ad hoc reporting so that business users can create reports as needed. - -- Data-driven subscriptions that route customized report output to a dynamic list of recipients. - -- Custom extensions for data processing, report delivery, custom authentication, and report rendering. - - The report server is implemented as Web service. Your application code must include calls to the Web service to access reports and other metadata. The Web service provides complete programmatic access to a report server instance. - - Because Reporting Services is a Web-based reporting technology, the default viewer shows reports that are rendered in HTML format. If you do not want to use HTML as the default report presentation format, you will have to write a custom report viewer for your application. - -### Creating Reports in Visual Studio for Reporting Services - To build reports that run on a report server, you create report definition (.rdl) files in Visual Studio through the Business Intelligence Development Studio, which is included with SQL Server 2005. - - The Business Intelligence Development Studio adds project templates that are specific to SQL Server components. To create reports, you can choose from the **Report Server Project** or **Report Server Project Wizard** templates. You can specify data source connections and queries to a variety of data source types, including SQL Server, Oracle, Analysis Services, XML, and SQL Server Integration Services. A **Data** tab, **Layout** tab, and **Preview** tab allow you to define data, create a report layout, and preview the report all in the same workspace. - - Report definitions that you build for the control or the report server can be reused in either technology. - -|To create a report that runs on a report server| -|---| -|1. On the **File** menu, choose **New**.
The **New Project** dialog box opens.
2. In the **Project types** pane, click **Business Intelligence Projects**.
3. In the Templates pane, select **Report Server Project** or **Report Server Project Wizard**.| - -## Using ReportViewer Controls and SQL Server Reporting Services Together - The ReportViewer controls and SQL Server 2005 Reporting Services can be used together in the same application. - -- The ReportViewer control provides a viewer that is used to display reports in your application. - -- Reporting Services provides the reports and performs all processing on a remote server. - - The ReportViewer control can be configured to show reports that are stored and processed on a remote Reporting Services report server. This type of configuration is called *remote processing mode*. In remote processing mode, the control requests a report that is stored on a remote report server. The report server performs all report processing, data processing, and report rendering. A finished, rendered report is returned to the control and displayed in the view area. - - Reports that run on a report server support additional export formats, have a different report parameterization implementation, use the data source types that are supported by the report server, and are accessed through the role-based authorization model on the report server. - - To use remote processing mode, specify the URL and path to a server report when configuring the ReportViewer control. diff --git a/docs/visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md b/docs/visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md deleted file mode 100644 index 7bea6d0e8addb..0000000000000 --- a/docs/visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "Deploying applications that reference the PrintForm component (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "PrintForm component [Visual Basic], deploying" -ms.assetid: b595ea44-a712-4625-a761-190c64f59bbe ---- -# Deploying applications that reference the PrintForm component (Visual Basic) -If you want to deploy an application that references the component, the component must be installed on the destination computer. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -## Installing the PrintForm as a prerequisite - To successfully deploy an application, you must also deploy all components that are referenced by the application. The process of installing prerequisite components is known as *bootstrapping*. - - When the component is installed on your development computer, a Microsoft Visual Basic Power Packs bootstrapper package is added to the Visual Studio bootstrapper directory. This package is then available when you follow the procedures for adding prerequisites for either [!INCLUDE[ndptecclick](~/includes/ndptecclick-md.md)] or Windows Installer deployment. - - By default, bootstrapped components are deployed from the same location as the installation package. Alternatively, you can choose to deploy the components from a URL or file share location from which users can download them as necessary. - -> [!NOTE] -> To install bootstrapped components, the user might need administrative or similar user permissions on the computer. For [!INCLUDE[ndptecclick](~/includes/ndptecclick-md.md)] applications, this means that the user will need administrative permissions to install the application, regardless of the security level specified by the application. After the application is installed, the user can run the application without administrative permissions. - - During installation, users will be prompted to install the component if it is not present on the destination computer. - - As an alternative to bootstrapping, you can pre-deploy the component by using an electronic software distribution system like Microsoft Systems Management Server. - -## See also -- [How to: Install Prerequisites with a ClickOnce Application](/visualstudio/deployment/how-to-install-prerequisites-with-a-clickonce-application) -- [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) diff --git a/docs/visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md b/docs/visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md deleted file mode 100644 index 400279eb748b6..0000000000000 --- a/docs/visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "How to: Print a Form by Using the PrintForm Component (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "Form [Visual Basic], printing" -ms.assetid: df963bf6-3ee1-49f4-8b2e-1d95d1beb0be ---- -# How to: Print a Form by Using the PrintForm Component (Visual Basic) -The component enables you to quickly print an image of a form exactly as it appears on screen without using a component. The following procedures show how to print a form to a printer, to a print preview window, and to an Encapsulated PostScript file. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -### To print a form to the default printer - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component is added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a **Print**`Button`). - - ``` - PrintForm1.Print() - ``` - -### To display a form in a print preview window - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component is added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a **Print**`Button`). - - ``` - PrintForm1.Print() - ``` - -### To print a form to a file - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component is added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Optionally, select the property and type the full path and file name for the destination file. - - If you skip this step, the user will be prompted for a file name at run time. - -4. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a **Print**`Button`). - - ``` - PrintForm1.Print() - ``` - -## See also -- -- -- [How to: Print the Client Area of a Form](../../../visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md) -- [How to: Print Client and Non-Client Areas of a Form](../../../visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) -- [How to: Print a Scrollable Form](../../../visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md) -- [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) diff --git a/docs/visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md b/docs/visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md deleted file mode 100644 index 47d69428c793c..0000000000000 --- a/docs/visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "How to: Print a Scrollable Form (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "entire form [Visual Basic], printing" - - "scrollable form [Visual Basic], printing" -ms.assetid: 1196e1cf-b77f-4928-a3e4-85b51ba3787d ---- -# How to: Print a Scrollable Form (Visual Basic) -The component enables you to quickly print an image of a form without using a component. By default, only the currently visible part of the form is printed; if a user has resized the form at run time, the image may not print as intended. The following procedure shows how to print the complete client area of a scrollable form, even if the form has been resized. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -### To print the complete client area of a scrollable form - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component will be added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a **Print**`Button`). - - ``` - PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable) - ``` - - > [!NOTE] - > On some operating systems, text or graphics drawn by methods may not print correctly. In this case, you will not be able to print with the `Scrollable` parameter. - -## See also -- -- -- [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) -- [How to: Print the Client Area of a Form](../../../visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md) -- [How to: Print Client and Non-Client Areas of a Form](../../../visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) diff --git a/docs/visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md b/docs/visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md deleted file mode 100644 index 11cde3a1b3f20..0000000000000 --- a/docs/visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "How to: Print Client and Non-Client Areas of a Form (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "title bar [Visual Basic], printing" - - "printing" - - "borders [Visual Basic], printing" - - "entire form" - - "non-client area [Visual Basic], printing" -ms.assetid: 856bb0e4-dbc3-47e2-81cd-4b376cf07757 ---- -# How to: Print Client and Non-Client Areas of a Form (Visual Basic) -The component enables you to quickly print an image of a form exactly as it appears on screen without using a component. The following procedure shows how to print a form, including both the client area and the non-client area. The non-client area includes the title bar, borders, and scroll bars. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -### To print both the client and the non-client areas of a form - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component is added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a Print `Button`). - - ``` - PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.FullWindow) - ``` - - > [!NOTE] - > On some operating systems, text or graphics drawn by methods may not print correctly. In this case, use the compatible printing method: `PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeFullWindow`). - -## See also -- -- -- [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) -- [How to: Print a Scrollable Form](../../../visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md) diff --git a/docs/visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md b/docs/visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md deleted file mode 100644 index d7294df7f1530..0000000000000 --- a/docs/visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "How to: Print the Client Area of a Form (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "client area [Visual Basic], printing" -ms.assetid: c06c9c0e-bc07-48cd-9596-e29a2ff96236 ---- -# How to: Print the Client Area of a Form (Visual Basic) -The component enables you to quickly print an image of a form without using a component. The following procedure shows how to print just the client area of a form, without the title bar, borders, and scroll bars. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -### To print the client area of a form - -1. In the **Toolbox**, click the **Visual Basic PowerPacks** tab and then drag the component onto the form. - - The component is added to the component tray. - -2. In the **Properties** window, set the property to . - -3. Add the following code in the appropriate event handler (for example, in the `Click` event handler for a **Print**`Button`). - - ``` - PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.ClientAreaOnly) - ``` - - > [!NOTE] - > On some operating systems, text or graphics drawn by methods may not print correctly. In this case, use the compatible printing method: `PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption CompatibleModeClientAreaOnly).` - -## See also -- -- -- [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) -- [How to: Print Client and Non-Client Areas of a Form](../../../visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) -- [How to: Print a Scrollable Form](../../../visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md) diff --git a/docs/visual-basic/developing-apps/printing/index.md b/docs/visual-basic/developing-apps/printing/index.md deleted file mode 100644 index 895251cd82236..0000000000000 --- a/docs/visual-basic/developing-apps/printing/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "Printing and Reporting (Visual Basic)" -ms.date: 07/20/2015 -ms.assetid: 92997b65-0279-4889-8db7-32cb6708be9c ---- -# Printing and Reporting (Visual Basic) -Visual Basic offers several options for printing and reporting. The following topics provide overviews and links to the relevant documentation related to printing and reporting. - -## In This Section - [PrintForm Component](../../../visual-basic/developing-apps/printing/printform-component.md) - Provides an overview of the `PrintForm` component that enables printing the contents of a form. - - [How to: Print a Scrollable Form](../../../visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md) - Explains how to print a scrollable form by using the `PrintForm` component. - - [How to: Print Client and Non-Client Areas of a Form](../../../visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) - Explains how to print both the client and non-client areas of a form by using the `PrintForm` component. - - [How to: Print the Client Area of a Form](../../../visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md) - Explains how to print the client area of a form by using the `PrintForm` component. - - [How to: Print a Form by Using the PrintForm Component](../../../visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md) - Explains how to print a basic form by using the `PrintForm` component. - - [Deploying Applications That Reference the PrintForm Component](../../../visual-basic/developing-apps/printing/deploying-applications-that-reference-the-printform-component.md) - Discusses how to deploy the `PrintForm` component together with an application. - - [Adding Printable Reports to Visual Studio Applications](../../../visual-basic/developing-apps/printing/adding-printable-reports-to-visual-studio-applications.md) - Discusses options available for writing reports. diff --git a/docs/visual-basic/developing-apps/printing/printform-component.md b/docs/visual-basic/developing-apps/printing/printform-component.md deleted file mode 100644 index 93b61ebbc3d81..0000000000000 --- a/docs/visual-basic/developing-apps/printing/printform-component.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: "PrintForm Component (Visual Basic)" -ms.date: 07/20/2015 -helpviewer_keywords: - - "PrintForm component [Visual Basic]" -ms.assetid: 03de98b8-b54c-4764-91d7-83c64e974750 ---- -# PrintForm Component (Visual Basic) -The component for Visual Basic enables you to print an image of a Windows Form at run time. Its behavior replaces that of the `PrintForm` method in earlier versions of Visual Basic. - - The PowerPack controls are no longer included in Visual Studio, but you can download them from the [Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=25169). - -## PrintForm Component Overview - A common scenario for Windows Forms is to create a form that is formatted to resemble a paper form or a report, and then to print an image of the form. Although you can use a component to do this, it would require a lot of code. The component enables you to print an image of a form to a printer, to a print preview window, or to a file without using a component. - - The component is located on the **Visual Basic PowerPacks** tab of the **Toolbox**. When it is dragged onto a form it appears in the component tray, the small area under the bottom border of the form. When the component is selected, properties that define its behavior can be set in the **Properties** window. All of these properties can also be set in code. You can also create an instance of the component in code without adding the component at design time. - - When you print a form, everything in the client area of the form is printed. This includes all controls and any text or graphics drawn on the form by graphics methods. By default, the form's title bar, scroll bars, and border are not printed. Also by default, the component prints only the visible part of the form. For example, if the user resizes the form at run time, only the controls and graphics that are currently visible are printed. - - The default printer used by the component is determined by the operating system's Control Panel settings. - - After printing is initiated, a standard printing dialog box is displayed. This dialog box enables users to cancel the print job. - -### Key Methods, Properties, and Events - The key method of the component is the method, which prints an image of the form to a printer, print preview window, or file. There are two versions of the method: - -- A basic version without parameters: `Print()` - -- An overloaded version with parameters that specify printing behavior: `Print(printForm As Form, printFormOption As PrintOption)` - - The `PrintOption` parameter of the overloaded method determines the underlying implementation used to print the form, whether the form's title bar, scroll bars, and border are printed, and whether scrollable parts of the form are printed. - - The property is a key property of the component. This property determines whether the output is sent to a printer, displayed in a print preview window, or saved as an Encapsulated PostScript file. If the property is set to , the property specifies the path and file name. - - The property provides access to an underlying object that enables you to specify such settings as the printer to use and the number of copies to print. You can also query the printer's capabilities, such as color or duplex support. This property does not appear in the **Properties** window; it can be accessed only from code. - - The property is used to specify the form to print when you invoke the component programmatically. If the component is added to a form at design time, that form is the default. - - Key events for the component include the following: - -- event. Occurs when the method is called and before the first page of the document prints. - -- event. Occurs after the last page is printed. - -- event. Occurs immediately before each page is printed. - -### Remarks - If a form contains text or graphics drawn by methods, use the basic (`Print()`) method to print it. Graphics may not render on some operating systems when the overloaded method is used. - - If the width of a form is wider than the width of the paper in the printer, the right side of the form might be cut off. When you design forms for printing, make sure that the form fits on standard-sized paper. - -## Example - The following example shows a common use of the component. - -``` -' Visual Basic. -Dim pf As New PrintForm -pf.Form = Me -pf.PrintAction = PrintToPrinter -pf.Print() -``` - -## See also -- -- -- [How to: Print a Form by Using the PrintForm Component](../../../visual-basic/developing-apps/printing/how-to-print-a-form-by-using-the-printform-component.md) -- [How to: Print the Client Area of a Form](../../../visual-basic/developing-apps/printing/how-to-print-the-client-area-of-a-form.md) -- [How to: Print Client and Non-Client Areas of a Form](../../../visual-basic/developing-apps/printing/how-to-print-client-and-non-client-areas-of-a-form.md) -- [How to: Print a Scrollable Form](../../../visual-basic/developing-apps/printing/how-to-print-a-scrollable-form.md)