Reports for WinForms | ComponentOne
In This Topic
    Reports for WinForms Samples
    In This Topic

    Please be advised that this ComponentOne software tool is accompanied by various sample projects and/or demos which may make use of other development tools included with the ComponentOne Studio Enterprise.

    Please refer to the pre-installed product samples through the following path:

    Documents\ComponentOne Samples\WinForms

    Reporting Samples

    Click one of the following links to view a list of reporting samples:

    Visual Basic Samples

    Sample Description
    Chart Add charts to reports using C1Report and C1Chart.
    CreateReport Create reports dynamically using code. This sample uses the C1Report component.
    CustomData Create custom data source objects for use with C1Report. This sample uses the C1Report and C1PrintPreview component.
    Embedded Load report definitions into the C1Report component at design time. This sample uses the C1Report and C1PrintPreview component.
    HtmlFields Render reports to HTML preserving HTML formatting.
    Newsletter Create reports without data sources (unbound reports). This sample uses the C1Report and C1PrintPreview components.
    NorthWind View reports imported from the NorthWind database. This sample uses the C1Report component.

    C# Samples

    Sample Description
    AddScriptObject Add custom objects to C1Report's script engine.
    AdHocSorting Select the sorting criteria before rendering the report.
    ADOReport Use ADODB.Recordset objects as C1Report data sources.
    AzureC1Report
    C1dView This sample implements a report and document viewer application with a user interface based on two other ComponentOne products - C1Ribbon and C1Command. It also provides a Visual Studio project item template that can be used to add a fully customizable ribbon preview form to your application.
    C1ReportsScheduler Provides a Windows service C1ReportsSchedulerService that can be used to run (generate and export or print) C1Report and C1PrintDocument objects on schedule at specified times and intervals. For details, run the C1ReportsScheduler.exe frontend, and click Help | Contents.
    Chart Add charts to reports using C1Report and C1Chart. This sample uses the C1Report and C1Chart components.
    CreateReport Create reports dynamically using code. This sample uses the C1Report component.
    CustomFields Create custom Chart and Gradient fields that can be added to any report.
    CustomHyperlinks Perform custom actions when hyperlinks are clicked.
    CustomPaperSize Create reports that use custom paper sizes. This sample uses the C1Report and C1PrintPreview components.
    DynamicFormat Use script properties to format the report based on its contents. This sample uses the C1Report component.
    Email Send reports by e-mail.
    ExportXml Export reports to an XML format.
    FlexReport Use a C1FlexGrid control as a data source for your reports.
    HierReport Create reports based on hierarchical data. This sample uses the C1Report component.
    HtmlFields Render reports to HTML preserving HTML formatting.
    Images Load images into a report using two methods.
    MixedOrientation Renders two C1Reports (one portrait, one landscape) into a single PDF document.
    PageCountGroup Keep separate page counts for each group in a report.
    ParameterizedFilter Create reports with a parameterized filter.
    ParseParameters Parse a PARAMETERS statement in a RecordSource string. This sample uses the C1Report component.
    ProgressIndicator Display a progress indicator form while a report is rendered.
    ReportBrowser Open report definition files and list their contents. This sample uses the C1Report component.
    ReportBuilder Create report definitions automatically based on DataTables.
    ReportDictionary Add a custom look up dictionary object to C1Report's script engine.
    RTFReport Shows how to render RTF fields in a report. This sample uses the C1Report component.
    SubReportDataSource Use custom data sources with subreports. This sample uses the C1Report component.
    XMLData Use any XML document as a report data source. This sample uses the C1Report component.
    ZipReport Compress and encrypt report definition files. This sample uses the C1Report and C1Zip components.

    XML Samples

    Sample Description
    CommonTasks A collection of reports that show how to perform common tasks.
    SampleReports XML report definition files that show C1Report's features.

    C1ReportDesigner Samples

    Sample Description
    SimpleDesigner Uses the C1ReportDesigner control to implement a simple report designer.

    Printing and Previewing Samples

    Click the following link to view a list of previewing samples:

    Visual Basic and C# Samples

    Sample Description
    AutoSizeTable The sample shows how to adjust the widths of a table's columns based on their content. The sample provides a method AutoSizeTable that can be used as-in in any application that needs to automatically size tables based on their content.
    CoordinatesOfCharsInText Shows how to use the GetCharRect() method (advanced). The sample shows how to use the GetCharRect() method available on RenderText and RenderParagraph classes, which allows to find out the position and size of individual characters in the text. In the sample, a red rectangle is drawn around each character.
    DataBinding The sample demonstrates binding to a simple list (including binding to an empty list), binding to a MS Access database, the use of grouping, aggregate functions, and binding of table row/column groups. This sample requires a 2006 v3 version (C1Preview.2 2.0.20063.41002) or later.
    Hyperlinks Shows how to create various types of hyperlinks The sample demonstrates how to create and set up several types of hyperlinks supported by C1PrintDocument and the preview controls: hyperlinks to anchors within the same document, hyperlinks to anchors in other C1PrintDocument objects, hyperlinks to locations within the document (render objects, pages), hyperlinks to external files/URLs.
    ObjectCoordinates The sample shows how to connect the coordinates in the preview pane with the objects in the C1PrintDocument being previewed. Methods are provided that find the RenderObject currently under the mouse, query the properties of the object, highlight it in the preview, and manipulate it: change the object's background color, text, or other properties. The changes are immediately reflected in the document. Note that for highlighting to work this sample requires a 2006 v2 version (C1Preview.2.0.20062.40855) or later.
    PageLayout1 Shows how to use the PageLayouts property. The sample creates a document with different page layouts for the first page, even pages and odd pages. The different layouts are specified declaratively via the PageLayouts property of C1PrintDocument, no even handling is involved.
    PageLayout2 Shows how to use the LayoutChangeBefore property of RenderObject. The sample creates a document with an object that forces a page break, and a different page layout that is "nested" within the current layout, so that the current layout is automatically restored when the nested object is over.
    RenderObjects Introduces most of the RenderObject types provided by C1PrintDocument. The sample creates and previews a C1PrintDocument, in which most of the RenderObject types provided by C1PrintDocument are included: RenderArea, RenderText, RenderGraphics, RenderEmpty, RenderImage, RenderRichText, RenderPolygon, RenderTable, RenderParagraph.
    RenderTOC Shows how to use the RenderToc object. The sample demonstrates how to create the table of contents for a document using the dedicated RenderToc render object.
    RotatedText The sample shows how to insert rotated text into C1PrintDocument.Text rotated at different angles is shown.
    Stacking Shows how to use stacking rules for render objects' positioning The sample demonstrates how to use the RenderObject.Stacking property to set stacking rules for block (top to bottom and left to right) and inline (left to right) positioning of objects. Relative positioning of objects is also demonstrated.
    Tables1 Shows how to create tables, set up table headers and footers. The sample creates and previews a C1PrintDocument with a table. Demonstrates how to set up table headers (including running headers) and footers. Shows how to add orphan control (the minimum rows printed on the same page before the footer is specified).
    Tables2

    The sample shows the basic features of tables in C1PrintDocument. The following features of tables are demonstrated: Table borders (GridLines property, allowing to specify the 4 outer and 2 inner lines).

    • Borders around individual cells and groups of cells.
    • Style attributes (including borders) for groups of disconnected cells.
    • Cells spanning rows and columns.
    • Content alignment within the cells (spanned or otherwise).
    • Table headers and footers.
    • Tags (such as page number/total page count) in table footer.
    • Style attributes: borders, font and background images.
    Tables3 Shows multiple inheritance of styles in C1PrintDocument tables. The sample demonstrates multiple inheritance of styles in tables. A table with some test data is inserted into the document. Some style attributes are redefined for the styles of a row, a column, and a cell group. Cells at the intersections of the groups inherit styles for all, combining them.
    TabPosition Shows how to use the TabPosition property of text rendering objects. The sample creates a document with a RenderParagraph object, on which the TabPositions property is defined, specifying the tab positions calculated on document reflow depending on the current page width.
    VisibleRowsCols Demonstrates the Visible property of table rows/columns. The sample shows the Visible property of RenderTable rows and columns, that allows to you hide table rows and columns without removing them from the table. This sample requires a 2006 v3 version (C1Preview.2 2.0.20063.41002) or later.
    WideTables Shows how to create wide tables spanning several pages The sample demonstrates the feature of C1PrintDocument which allows rendering of wide objects spanning multiple pages horizontally. To enable this feature, the object's CanSplitHorz property should be set to True. The preview is also adjusted to better show wide objects (margins are hidden, the gap between pages set to zero, and the end user is prevented from showing the margins).
    WrapperDoc This sample provides source code for a very simple wrapper around the new C1PrintDocument implementing some of the RenderBlock/Measure methods from the "classic" (old) C1PrintDocument. This sample may be especially useful to facilitate conversions of applications using the classic preview to the new preview.
    ZeroWidthRowsCols Demonstrates the treatment of table columns with zero width. The sample shows that columns with zero width/rows with zero height are not rendered at all (as if their Visible property were set to False). This sample requires a 2006 v3 version (C1Preview.2 2.0.20063.41002) or later.