ActiveReports Developer 7
Single Layout Reports
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > Samples and Walkthroughs > Walkthroughs > Page Report Walkthroughs > Single Layout Reports

Glossary Item Box

fixed page layout, allows you to create a layout at design time on a single page tab and apply it to the entire report. Designing a layout in this format gives you the advantage of creating a layout that appears exactly the same at design time and runtime. This walkthrough illustrates how to create a report that contains a single layout and preview it.

This walkthrough is split into the following activities:

Note: This walkthrough uses the DVDStock table from the Reels database. By default, in ActiveReports, the Reels.mdb file is located at [User Documents folder]\ComponentOne Samples\ActiveReports Developer 7\Samples\Data\Reels.mdb.

When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.

Design Time Layout


Notice that the runtime report layout below is similar to the one you see at design time except for the data which you see at runtime or when you preview the report.

Runtime Layout


ShowTo add an ActiveReport to the Visual Studio project

  1. Create a new Visual Studio project.
  2. From the Project menu, select Add New Item.
  3. In the Add New Item dialog that appears, select ActiveReports 7 Page Report and in the Name field, rename the file as rptSingleLayout.
  4. Click the Add button to open a new fixed page report in the designer.

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

ShowTo connect the report to a data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the Add button.
  2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like ReportData.
  3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting to a data source.

ShowTo add a dataset

  1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data Set from the Add button.
  2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as DVDList. This name appears as a child node to the data source icon in the Report Explorer.
  3. On the Query page of this dialog, in the Query field enter the following SQL query.
    SQL Query Copy Code
    Select * from dvdstock
    
  4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.

  5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.

ShowTo create a layout for the report

  1. In the Visual Studio toolbox, go to the ActiveReports 7 Page Report tab and drag a TextBox control onto the design surface.
  2. Select the TextBox control and go to the Properties window to set the following properties.
    Property Name Property Value
    Location 0.25in, 0.5in
    BackgroundColor Khaki
    Color Maroon
    Font Normal, Arial, 16pt, Bold
    Size 6in, 0.5in
    TextAlign Center
    Value DVD STOCK
  3. From the Visual Studio toolbox, drag a Table data region and place it on the design surface.
  4. Select the Table and go to the Properties window to set the following properties.
    Property Name Property Value
    Location 0.25in, 1in
    BackgroundColor Khaki
    FixedSize 6in, 7.5in
    RepeatHeaderOnNewPage True
    Size 6in, 0.75in
  5. In the Table data region, place your mouse over the cells of the table details row to display the field selection adorner.
  6. Click the adorner to show a list of available fields from the DataSet and add the following fields to the cells of the table details row.

    Cell Field
    Left Cell Title
    Middle Cell InStock
    Right Cell StorePrice
    This automatically places an expression in the details row and simultaneously places a static label in the header row of the same column.
    Tip: You can also directly drag fields from the Report Explorer onto the textbox cells of the Table data region.
  7. Select the columns of the Table and set their Width property as follows:
    Cell Field
    Left Cell 2.5in
    Middle Cell 1.75in
    Right Cell 1.75in
  8. Select the following table rows and go to the Properties window to set their following properties.
    Row Properties
    Table Header BorderStyle: Solid
    Color: Maroon
    Font: Normal, Arial, 12pt, Bold
    TextAlign: Left
    Table Details BorderStyle: Solid
    Font: Normal, Arial, 10pt, Bold
    TextAlign: Left

ShowTo view the report

  • Click the preview tab to view the report at design time.

OR

See Also

©2014. ComponentOne, a division of GrapeCity. All rights reserved.