ActiveReports 15 .NET Edition
ActiveReports 15 User Guide / Concepts / Report Parts / Create report using Report Parts
In This Topic
    Create report using Report Parts
    In This Topic

    This topic illustrates a step-by-step implementation for creating a report using Report Parts to display annual sales of an organization.

    Note:
    • This topic uses the SalesReport.rdlx report file. The SalesReport.rdlx file can be downloaded from GitHub: ..\Samples15\Data\Reels.mdb.
    • Although this topic uses Page reports, you can also implement report parts in RDL and Section reports.

    When you complete these steps, you will have a layout that looks similar to the following at design time and at run time.

    Design Time Layout

    Layout of report using report parts at design time

    Layout of report using report parts at design time

    Run-Time Layout

    Layout of report using report parts at run time

    Layout of report using report parts at run time

    Create an ActiveReports project in Visual Studio

    1. Create a new Visual Studio project.
      Create a New Project dialog

      Create a New Project dialog



    2. In the New Project dialog that appears, select ActiveReports 15 Page Report Application and in the Name field, name the file as rptReportParts.
    3. Click OK to create a new ActiveReports 15 Page Report Application. By default a Page report is added to the project.

    See Basic Concepts for information on adding different report layouts.

    Create a layout for the report

    1. Select PageReport1.rdlx from the Solution Explorer.
    2. Open the Reports Library window. For more information on how to open the Reports Library window, see Show or Hide the Reports Library.
    3. To add a report part from the Reports Library window, right-click the Library node and select Add.
    4. In the Open dialog that appears, navigate to SalesReport.rdlx file. Controls from SalesReport.rdlx are added as Report parts to your Report Library 15 window.
    5. Drag and drop the salesOverTime chart control from the Reports Library window onto the design surface. The report part is added to your report along with its data sources, data sets and parameters.
    6. Drag and drop the Image1 image from the Reports Library window onto the design surface.
    7. From the Visual Studio toolbox, drag and drop a Table data region onto the design surface.
    8. Hover over TextBox4 to reveal the field selection adorner, click it to display a list of available fields, and select the SaleDate field.
    9. Hover over TextBox5 to reveal the field selection adorner, click it to display a list of available fields, and select the Quantity field.
    10. Hover over TextBox6 to reveal the field selection adorner, click it to display a list of available fields, and select the Profit field.
    11. From the Visual Studio toolbox, drag and drop a Textbox control onto the design surface.
    12. Select the Textbox to view its properties in the Properties window and enter the text Annual Sales Report (2004-2005) in the Value property.

    Enhance the appearance of the report

    When you preview the report at this point, you will notice the data from the fields is displayed in the Table data region. Let us now work on the report appearance to further enhance the layout.

    1. From the designer, select the Image control and then go to Properties Window to set the following properties.
      Property Name Property Value
      Location 0.095in, 0.156in
      Size 1.3in, 1.1in
    2. From the designer, select TextBox10 and then go to Properties Window to set the following properties.
      Property Name Property Value
      Location 1.5in, 0.5in
      Size 4.3in, 0.3in
      BorderStyle Solid
      FontWeight Bold
      TextAlign Center
      FontSize 16pt
    3. From the designer, select the Chart data region and then go to Properties Window to set the following properties.
      Property Name Property Value
      Location 0.1in, 1.3in
      Size 6in, 4.125in
    4. From the designer, select the Table data region and then go to Properties Window to set the following properties.
      Property Name Property Value
      Location 1.25in, 5.5in
      Size 4.25in, 1in
      FixedSize 4.25in, 3.35in
      RepeatHeaderOnNewPage True
    5. In the Table data region, select the textbox that contains the following fields and go to the Properties window to set the following properties.
      Cell Property Name Property Value
      Sale Date BackgroundColor LightCyan
      BorderStyle Solid
      FontWeight Bold
      TextAlign Center
      =[SaleDate] BorderStyle Solid
      TextAlign Center
      Quantity BackgroundColor LightCyan
      BorderStyle Solid
      FontWeight Bold
      TextAlign Center
      =[Quantity] BorderStyle Solid
      TextAlign Center
      Profit BackgroundColor LightCyan
      BorderStyle Solid
      FontWeight Bold
      TextAlign Center
      =[Profit] BorderStyle Solid
      TextAlign Center
      Format Currency

    View the report

    OR