ActiveReports 9 practical tutorial (3): illustrated reports, activereports

Source: Internet
Author: User

ActiveReports 9 practical tutorial (3): illustrated reports, activereports

Based on the above two sections, we have set up the AR9 development environment and configured the data source. In this section, we will present the functions of AR9 with three official Chinese graphic reports and share them one by one.

In the past, when I was doing report-related work, I was most afraid of the report's uidesign work. When I encountered a report with a very complex layout, it usually took two or three minutes to complete the report's uidesign work. In addition to the complexity of the report, the report designer does not provide enough functions to assist in the uidesign of the report.
ActiveReports is a very easy-to-use control, but some features are often forgotten-such as the configuration menu of AR reports.

When we open the ActiveReports report design screen (for example, double-click *. rdl ,*. rpx ,*. rdlx), we are most concerned about the toolbox and attribute window, but did not noticeReportsMenu options,ReportsThere are 6 menu items in total,Save Report,Report to server,Load report,Load reports from the server,Data Source,Set. Next, let's talk about it.SetMenu item.

1. Optional ruler Unit

ActiveReports provides two ruler units: Inches (Inches) and Centimeters (Centimeters). We can select a proper ruler unit based on our own needs, thus eliminating the hassle of length conversion. (Note: The default unit is inches)


2. Optional alignment

ActiveReports provides two alignment modes: SnapLines (align by edge) and Snap to Grid (align by table. When SnapLines is selected, the relative positional relationship between controls can be determined based on the alignment guides. When Snap to Grid is selected, the smallest unit of the control is the distance of a cell by moving the mouse, the correct position of the control can be determined based on the number of cells.

3. Optional grid spacing

When Show Grid is selected, the Grid is displayed in the design view of the report, and the number of grids can be adjusted. Selecting a proper ruler unit and number of grids can help us determine the location of the space. For example, if you select Centimeters (CM) as the ruler unit and set the number of grids to 10*10, the distance between adjacent grids is exactly 1mm.

After learning about the report layout, we will use three official demos for practical drills.

Report Practice 1: Regular Report-data list-customer list

In this example, the Lable and TextBox controls of AR reports are combined to display customer data in tables.

Step 1: Create an rptCustomerList. rpx report file

Step 2: create a data source

Step 3: Design PageHeader (Report header)

Drag the Label control of AR9, modify the displayed text, and adjust the background color.

In the upper-left corner of Pageheader, add a TextBox and follow the following modification summary algorithm to summarize the user information on the current page.

Step 4 design Detail (report data area)

To design the Detail area, drag the TextBox control from the AR9 toolbox through Step 3 to modify the DataField field content.

Here we use an AR report designedTips:Drag the field selected from the report Resource Manager to the Detail area..

Step 5 design the PageFooter Area

So far, we have completed the customer list report through the above practical steps.

Tips: The design and preview effects of reports can be easily achieved through the designer, script, and preview under the report designer, which is very efficient.

Verify the effect quickly:

Why is it different from the official website?

Add the following script to the script to modify the row color:

int RowNo = 0;public void detail_Format(){    if ((RowNo % 2) == 1)    {        this.detail.BackColor = Color.Gainsboro;    }    else    {        this.detail.BackColor = Color.Transparent;    }    RowNo++;}public void ActiveReport_ReportStart(){    rpt.Document.Printer.PrinterName = "";}


Report practice 2: Regular Report-chart Report-regular chart

In this example, Chart is used to display Chart data, which is more intuitive.

Step 1: Create an rptSalesByRegion. rdlx report

Step 2: create a data source

Step 3: add the Chart report Control

Select Show as column Chart-stacked Chart, select Chart, and then click the attribute dialog box.

Step 4: Fill in Chart data

You can also click Chart data to modify the sequence (series), category group, and sequence group data filling operations.

In this example, we perform operations according to the following data:

  • Drag "sales volume" to the sequence data area
  • Drag "category name" to the X axis data area
  • Drag "cargo owner region" to the sequential grouping area


Step 5: preview the Running Effect

Report Practice 3: Regular Report-bar code-Air China ticket

In this example, we use the bar code and the New rounded corner Design of AR9 to implement a report similar to Air China ticket.

Step 1: Create a rptFlightBarcode. rdlx report and Data Source

To add reports and data sources, please refer to the 1st example in this article. The data source SQL is used:


Select flight information. * from flight information order by ID;

Step 2: design the background image of the report

Add an Embedded Image

Add the Image report control and set the background Image of Air China ticket.

Step 3: Add a barcode

After the Image control is added, we can add a bar code control.


Configure bar code Properties


  • LayerName: Set to Layer1. To facilitate management, data controls are centrally placed on the Layer1 layer.
  • Symbology: Set it to Ansi39.
  • Value: Sets the barcode data to specify the ID number of the current ticket.


Remarks: The Barcode control provided by ActiveReports supports 37 bar code formats, including: code39 code, Code25 code, ITF25 code, Matrix25 code, UPC-A code, UPC-E code, EAN-13 code, EAN-8 code and other one-dimensional barcode and mega417 two-dimensional barcode.

Step 4: Add a data area

After adding the background image and bar code, start to drag the data field to fill in the passenger, starting point and other data information.

Sometimes designing a report is inconvenient to control between multiple layers, but the report cannot edit data.

Here is a new AR9Tips: In the AR Report, multiple layers directly switch visibility and select whether to select. Right-click the VS toolbar and select ActiveReports 9:

Then activate Layer Management --- layer list V9:

Step 5: run the complete demo:


The complete demo and Chinese database files officially provided:

To facilitate sharing and communication, you can also Watch through Git @ OSC.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.