ActiveReports 14
ActiveReports 14 User Guide / Samples and Walkthroughs / Walkthroughs / Page Report/RDL Report Walkthroughs / Layout / Single Layout Reports
In This Topic
    Single Layout Reports
    In This Topic

    Page Report, 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 run time. 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. The Reels.mdb file can be downloaded from GitHub: ..\Samples14\Data\Reels.mdb.
    • Although this walkthrough uses Page reports, you can also implement this using RDL reports.

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

    Design-Time Layout

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

    Run-Time Layout

     

    To 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 14 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 Quick Start for information on adding different report layouts.

    To 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.

    To 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.

    To create a layout for the report

    1. In the Visual Studio toolbox, go to the ActiveReports 14 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

    To view the report

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

    OR

    See Also