Step 1 of 4: Adding Previewing Controls to the Form
In this step you'll add Reports for WinForms controls to the form and set the form up to create a simple "Hello World!" document preview. The simplest possible document is one that prints the sentence "Hello, World!". Complete the following steps to set up the form to create such a document:
Note: The sample code fragments in this topic assume that the "using C1.C1Preview;" directive (in C# syntax; or an equivalent for other languages) has been inserted into the file, so that instead of fully qualified type names (such as C1.C1Preview.RenderText) we can use just the class name part (RenderText).
1. Create a new .NET Windows application, and name it HelloWorld. For information about creating a new project, see Creating a .NET Project.
2. Navigate to the Toolbox and double-click C1PrintPreviewControl to add it to your form.
A print preview control called C1PrintPreviewControl1and showing a sample document will appear on your form. The C1PrintPreviewControl control is a composite control containing a preview pane, navigation and text search panels, and toolbars with predefined buttons.
In addition, two additional entries will appear in the References part of your project: C1.C1Report.2 and C1.Win.C1Report.2.
3. In the Toolbox, double-click the C1PrintDocument icon to add the control to your project. The new component will be named C1PrintDocument1, by default, and will appear in the component tray below the form.
You've created a project and added Reports for WinForms previewing components to your project and completed step 1 of the quick start guide. In the next step you'll set up the form and controls.
|