ActiveReports 13
Creating a report using Report Parts
ActiveReports 13 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Common Walkthroughs > Layout > Creating a report using Report Parts

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

The walkthrough is spilt into the following activities:

Note:

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

Design Time Layout

Run-Time Layout

Creating an ActiveReports project in Visual Studio

  1. Create a new Visual Studio project.



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

See Adding an ActiveReport to a Project for information on adding different report layouts.

Creating 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 through the GrapeCity Samples folder hierarchy mentioned above and select SalesReport.rdlx. Controls from SalesReport.rdlx are added as Report parts to your Report Library 13 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.

Enhancing 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

Viewing the report

OR