Reports for WinForms | ComponentOne
In This Topic
    Creating a Basic Report Definition
    In This Topic

    You can design your report to display your data in a variety of ways on the printed page. Using the C1ReportDesigner application, you can design comprehensive lists, summaries, or special subsets of data, like an invoice.

    The easiest way to start a new report is to use the C1Report Wizard. In the C1Report Wizard click the Application button and select New from the menu to create a new report. To access the C1Report Wizard, click the New Report button from the Reports tab:

    From Visual Studio, you can also access the C1Report Wizard from the C1Report context menu or C1Report Tasks menu, click Edit Report. For more information accessing the Edit Report link, see C1Report Tasks Menu or C1Report Context Menu.

    The C1Report Wizard appears, and will guide you through five easy steps:

    1. Select the data source for the new report.

      Use this page to select the ConnectionString and RecordSource that will be used to retrieve the data for the report.

      You can specify the ConnectionString in three ways:

      • Type the string directly into the editor.
      • Use the drop-down list to select a recently used connection string (the Designer keeps a record of the last eight connection strings).
      • Click the button with the ellipsis button (...) to bring up the standard connection string builder.

      You can specify the RecordSource string in two ways:

      • Click the Table option and select a table from the list.
      • Click the SQL option and type (or paste) an SQL statement into the editor.

    2. Select the fields you want to include in the report.

      This page contains a list of the fields available from the recordset you selected in Step 1, and two lists that define the group and detail fields for the report. Group fields define how the data will be sorted and summarized, and detail fields define what information you want to appear in the report.

      You can move fields from one list to another by dragging them with your mouse pointer. Drag fields into the Detail list to include them in the report, or drag within the list to change their order. Drag fields back into the Available list to remove them from the report.

    3. Select the layout for the new report.

      This page offers you several options to define how the data will be organized on the page. When you select a layout, a thumbnail preview appears on the left to give you an idea of what the layout will look like on the page. There are two groups of layouts, one for reports that have no groups and one for reports with groups. Select the layout that best approximates what you want the final report to look like.

      This page also allows you to select the page orientation and whether fields should be adjusted to fit the page width.

      The Labels layout option is used to print Avery-style labels. If you select this option, you will see a page that prompts you for the type of label you want to print.

    4. Select the style for the new report.

      • Style Layouts
        This page allows you to select the style that will be used in the new report. Like the previous page, it shows a preview to give you an idea of what each style looks like. Select the one that you like best (and remember, you can refine it and adjust the details later).
      • Label Layout Only
        This page allows you to select the type of label you want to create. The Designer has over 170 predefined label types for you to choose from. The labels are divided into four groups, depending on whether they use metric or English measurements, and on the type of paper they use (sheets or continuous forms).
    5. Select a title for the new report.

      This last page allows you to select a title for the new report and to decide whether you would like to preview the new report right away or whether you would like to go into edit mode and start improving the design before previewing it.

      If you choose to preview the report and click finish, you will immediately see the report in the preview pane of the Designer. It should look like this: